Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




ListBox Drag And Drop Event.


I posted a message about displaying html code in color in a rich text box. this is the same app I'm working in.

does anyone have any advise on how I can drag something listed in a list box and drop it in an rtf? My rtf will contain alot of text.

OR

would it be easier to select an area in the rtfbox, select an item from the list and then "on_click" with a commandbutton insert the list box text into the selected area of the rtfbox?

Any advise would be helpfull.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Drag And Drop Event
I just noticed this:

I created a file splitter that, when you drag a file from explorer
onto the form, The project splits it up into N 80000 byte parts,
and a remainder part < 80000 bytes. Also, if you D&D N files onto
it, it ties them all together in an AlphaNumerical order. Its pretty
much automatic, the process is initiated from the OLEDragDrop
event.

Running it, I noticed that the Source Explorer Window freezes
until after the entire code has completed.

Below is the code that I initially used. As you can see, Once the
File(s) have been loaded into a listbox, CHECK_LIST is called.
CHECK_LIST is a pretty lengthy operation, and while its
processing, the initiating OLEDragDrop event stays active, thus
keeping an OLE Link to the Explorer Window active. This is what
locks the Explorer Window.



Code:
Private Sub Form_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim i As Integer
List1.Clear
Label2(2).Caption = ""
If Data.Files.Count > 0 Then
For i = 1 To Data.Files.Count
List1.AddItem Data.Files(i)
Next i
End If
Call CHECK_LIST
End Sub



So, I reasoned that instead of calling CHECK_LIST, I'd place a
timer on the form, and enable it at the end of the OLE Event.
The OLE event would then end, and the OLE Link would close,
freeing up the Explorer window.

The Timer,Now enabled, would disable itself, and then call
CHECK_LIST.

Here is My New Code:



Code:
Private Sub Form_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim i As Integer
List1.Clear
Label2(2).Caption = ""
If Data.Files.Count > 0 Then
For i = 1 To Data.Files.Count
List1.AddItem Data.Files(i)
Next i
End If
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
'''This is used because with the OLE_DROP
'''If "Call CHECK_LIST" is done in those
'''Subs, the explorer source window locks
'''Up until CHECK_LIST & Its calls are completed.
Timer1.Enabled = False
Call CHECK_LIST
End Sub



I Tested it, and it works great!

But, I Don't like it.

So, My Question (Yes, there is a question!) is:
Is there a way to break the OLE link when you're inside an
OLEDragDrap Procedure, without haveing to exit that procedure?

-Thanks
-Lou

Drag And Drop To Folder Event
I want to create an application that when installed, creates a special folder with my unique icon. When cetain types of files are dragged to this folder, my application kicks off and runs a process on them. Is this possible in VB, or do I need to search for a different language? I searched the forum and could not find any other post like this.

I also wanted to add, that my process will not have a form. Is this difficult too? I have never done this before.

Thanks,
Joe

Drag Drop Event Of Treeview Not Firing
Hi All,

The dragDrop event of my treeview isn't firing. What properties do I need to set for this to work. I used the following code for the OLEDrag methods but if I drag a node onto my listview in the same form for example it dissapears from the tree. That isn't supposed to happen.

I am thinking the code needs to be in the DragDrop Event and not the OLEDragDrop event.


Code:
Private Sub trvTree_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
Dim con As ADODB.Connection
Dim strSourceKey As String
Dim nodTarget As Node
Dim ArrSplit() As String
Dim NewId As Integer
Dim OldId As Integer
Dim ItemId As Integer

Set con = GetConnection

If blnDragging = True Then
'// get the carried data
strSourceKey = Data.GetData(vbCFText)
ArrSplit = Split(strSourceKey, ";")
'// get the target node
Set nodTarget = trvTree.HitTest(x, y)
'// if the target node is not a folder or the root item
'// then get it's parent (that is a folder or the root item)
''If nodTarget.Image <> "FolderClosed" And nodTarget.Key <> "Root" Then
'' Set nodTarget = nodTarget.Parent
''End If
'// move the source node to the target node
Set trvTree.Nodes(ArrSplit(0)).Parent = nodTarget.Parent
trvTree.Nodes(ArrSplit(0)).ForeColor = &H0&
NewId = CInt(Mid(nodTarget.Parent.Key, 2))
OldId = CInt(Mid(ArrSplit(1), 2))
ItemId = CInt(Mid(ArrSplit(0), 2))
'// NOTE: You will also need to update the key to reflect the changes
'// if you are using it

con.Execute ("UPDATE itemcategorytree " & _
"SET ParentId = " & NewId & " " & _
"WHERE id = " & ItemId & ";")


'// we are not dragging from this control any more
blnDragging = False
'// cancel effect so that VB doesn't muck up your transfer
Effect = 0
End If
End Sub

Private Sub trvTree_OLEDragOver(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single, State As Integer)
Dim nodNode As Node
'// set the effect
Effect = vbDropEffectMove
'// get the node that the object is being dragged over
Set nodNode = trvTree.HitTest(x, y)
If nodNode Is Nothing Or blnDragging = False Then
'// the dragged object is not over a node, invalid drop target
'// or the object is not from this control.
Effect = vbDropEffectNone
End If

End Sub

Private Sub trvTree_OLEStartDrag(Data As MSComctlLib.DataObject, AllowedEffects As Long)
'// Set the effect to move
AllowedEffects = vbDropEffectMove
'// Assign the selected item's key to the DataObject
Data.SetData trvTree.SelectedItem.Key & ";" & trvTree.SelectedItem.Parent.Key
'// we are dragging from this control
If Mid(trvTree.SelectedItem.Key, 1, 1) = "i" Then
blnDragging = True
Else
blnDragging = False
End If
End Sub

The Drag/Drop Event Of An Image Control.
here I am again... seems as though my other thread died, so I am starting this one. In this one, I hope to attract the input of some of you who will walk me through making a for with an image control in it, into which I can drop a person's picture (probably a .jpg file) and then be able to save the image file/info to a database. Anyone willing to help me get started on this?

I sure would appreciate it


Happieman
a.k.a. Bill

Intercepting A Drag-n-Drop Event In ExcelXP
Hi all,

I'm working in Excel 2002/VBA, trying to manipulate elements of a single worksheet of data.

To allow me to speed this up, I want to enable drag-and-drop of complete ROWS of the spreadsheet, however when the rows are moved I want to change some of the cell values to reflect their new positions.

To do this I need to intercept the drag-and-drop event AFTER the move has occured, then quickly perform some calculations.

I think the event-handler is probably the following piece of code ... however I don't know how to recognise the drag-and-drop events - a quick macro showing examples of the move I want to recognise is shown. It's a drag-and-drop whilst holding the <shift> key.

Code:Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

    Rows("11:13").Select
    Selection.Cut
    Rows("5:7").Select
    Selection.Insert Shift:=xlDown

End Sub

The only bit that's missing is that the specific worksheet I want to capture events on is worksheets("Data").

Regards, and thanks in advance,
Stuart

Drag And Drop From Listbox
I have some listboxes on a form and I want to drag values between them. What is the best way to drag from one listbox and drop into one of the others. I'm playing with Mousedown and Mouseup, but I'm not sure that is the solution. How do you know which listbox you are dragging to?

Thanks,
--bnpatten
Richmond,VA

Drag And Drop With Listbox
i have searched the forums but there seems to be a few different ways of simply dragging an item out of list1 and putting it in list2, as any body got any sample code that is the usual way of doing this

thank you.
casey.

Listbox Drag And Drop
Hi !
I want to drag and drop an item fom a list box.
I'm able to drag this item to a text box.
But I when I do so it seems like all the listbox is moving. What can I do if I want to see like i'm moving only one item from this list box ?

Drag N' Drop From Listbox?
is it possible to drag and drop from one listbox to another, with the original one having been populated from my database? if so how would i go about this? thanks!

Drag And Drop From One Listbox To Another
I have two listboxes labeld From and To.

I need to move items from the From box to the To box.

I have four buttons:

cmdTo (moves all selected items from the From box to the To box)
cmdToAll (moves ALL items from the From box to the To box)
cmdBack (moves all selected items from the To box back to the From box)
cmdBackAll (moves ALL items from the To box back to the From box)

All works well and life is good.

Now, however, I'm being asked to add drag and drop functionality. My users want to be able to select items in the From box and Drag them over to the To box and Drop them in.

I don't even use the Drag and Drop functionality built into Windows and I've never built such functionality before.

Can anyone at least get me started?

Drag'n Drop Listbox?
Can anyone tell me if it's possible to drag and drop from a listbox, if it is, can you tell me where to go to find out how to do it?

Listbox Drag And Drop.
Until Arc has finished his listboxx OCX I am stuck with the microsoft offering. SO my problem is this, is there any way to implement re-ordering listbox items by dragging and dropping?

Everso

Listbox Drag && Drop
I am trying to create a form with multiple listboxes from which I can drag & drop from one list to any other list.
I have looked at CTLIST.OCX by DBI Technologies (www.dbi-tech.com/product_info/ctocx.htm)
but it seems this control will only allow drag & drop between 2 list only.

Can someone please help?

Listbox Drag && Drop
i am draging and droping file from desktop and list1 contaning file name and list2 contaning it's location but location says "c:windowsdesktop" but i like to have it's Targetlocation (when you right click on icon from desktop and goto "Shortcut" tab and there will be "Target" that's i am talking about) how do i get that targetlocation. I realy need help for this please help me.

Listbox Drag And Drop
i have 2 listbox how could i make program that when i drag and drop item from desktop list1 get the file name and list2 get complet location (ex:"c:Program filesInternet ExplorerIexplore.exe"). Does any one know how to do this please help me.
Thank you

Drag-Drop From One Listbox To Another
Can you tell me how to implement Drag-Drop between 2 listboxes?

I want to drag an item from one listbox and drop it into another..

Thanx..

ListBox Drag&drop
I have two list boxs that i can drag from one to anther. The point is that the item is inserted in the begining of the target list. I want that the item will be inserted where the user put the cursor on (in the x,y position) How can i do it?

Here is the routine:

Private Sub List1_DragDrop(Source As Control, X As Single, Y As Single)
On Local Error Resume Next
If Source Is List1 Or Source.List(Source.ListIndex) = "" Then Exit Sub
List1.AddItem Source.List(Source.ListIndex) 'Adds the item to the target
Source.RemoveItem Source.ListIndex 'Removes the item from the source
End Sub

Drag And Drop From Listview Onto Listbox
I need to be able to perform a drag'n'drop from a listview in report-view mode onto a listbox.

I can get the first item (I want to multiple select too) that is dropped, however I cannot do the following:

1) I want multiple, performing a For Each vfn In Data.GetData(1) doesn't work, I get can the first item by msgbox data.getdata(1)

2) The destination listbox, how can I tell what item in the listbox that the dragged objects have landed on.

Cheers!

Carl.

Drag And Drop Files Into A Listbox
I found this thread that says how to do it for a text box...

Link to the thread about Text boxes

it had this code:


Code:
Private Sub Text1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single )
Dim i As Integer

Effect = vbDropEffectCopy
For i = 1 To Data.Files.Count
Text1 = Text1 & Data.Files(i) & ";"
Next i
Text1 = Left(Text1, Len(Text1) - 1)
End Sub

Private Sub Text1_OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer )
Effect = vbDropEffectCopy
End Sub
but I don't quite understand how I can get it to work with a listbox and so it'll display multiple file paths on each line of the box.

(sorry if I didn't explain that right)

Drag Drop From Listbox To Picture
OK i have a listbox and I want to be able to select an item and when i drag it onto the form I want it to become an image in an imagebox. Then when i take my finger of the mouse if it isn't within certain (X,Y) co-ords I want it to disappear otherwise just move it to certain (X,Y) co-ordinates.

Drag && Drop Within A Listbox Or Listview?
Let's say you have a listbox containing 50 items (rows) that is populated from a database table. That listbox is sorted 1 through 50 based on a field called "ORDER".

If I want to allow the user of my VB application to change the order of the records (and the order field accordingly) using drag and drop, is that possible? What I'm thinking is that they can click on, say, item 32 in the list, and drag it up or down the list to the spot they are looking for and then my program will reorder everything.

Basically, my software has a combobox that is populated and ordered using this table. On certain occaisions the user has to change this order (for data entry purposes), so they need a fast way to go about this. The way the previous programmer made it, once they order one thing differently, they have to go all the way through the list again and reorder everything else. Any tips on how to make this smooth and relativley effortless for the end user would be appreciated.

Thanks again everyone

Listbox Drag And Drop Problem
G'day,

I have 2 listboxes and want to drag/drop between them. I can do it from one to the other, but not the other way around.

I have zipped the files and attached.

What have I done wrong?

Drag Drop Problem In Listbox
Hi all

I've a prob when using the drag drop event in a listbox

I'm moving an item from one listbox to another like this


Code:
Private Sub lstReportGroups_DragDrop(Source As Control, X As Single, Y As Single)

Dim iIndex As Integer
Dim intListCount As Integer


If TypeOf Source Is ListBox Then
intListCount = Source.ListCount - 1

For iIndex = 0 To intListCount
If Source.Selected(iIndex) Then
lstReportGroups.AddItem Source.List(iIndex)
lstAvailableGroups.RemoveItem (iIndex)
Exit For
End If
Next

End If





My problem is when I select an item in one of the listboxes and drop it in the same listbox it appears again in that listbox.

How can I do if I want it to be impossible to drop the item in the 'source' listbox??

/C

Listbox Drag Drop Problem
Hello

I have a list box that the user can drag items up and down in. This works well enough except that you have to click and release on an an item and highlite it first before you can drag it. That part I can live with.
The thing that I would really like to change though is that when you drag an item you can't tell very well where you're dropping it. You get a drag icon and the pointer changes to let you know that your dragging. But it's hard to tell where it's actually going to get dropped when you release. So, What I'm looking for is for a way to have either the rows highlited as the mouse goes over them or a line that shows exactly where the cursor is pointing.
Any ideas?

Thanks

David

Rearrange A Listbox With Drag And Drop
I've been searching for a simple method to rearrage the order of items in a listbox allowing the person to drag rows up and down in the list. It does not seem to be as straight forward as I first assumed. Does anyone have any sample code to do this. the only sample code I found was dragging and dropping between different listboxes, not rearranging within the same one. Do I need to use the OLEDragStart, OLEDragDrop events? or can I simply use MouseDown, Mousemove, MouseUp events. Thanks
A sample would be much appreciated.
Marc

Urgent!! Listbox Drag And Drop
I'm trying to set up the drap and drop option between 2 listboxes and it will not work. When you click on it the icon changes and it looks like it is going to drag, but it will not drop anywhere. The main purpose of this is to be able to drag the files instead of having to select the text and then click add.

Drag & Drop Data From Listbox
Can anyone pls send me a code in VB ,so that i can drag one data from one
listbox and drop it in another listbox.
It should also support multiple drag and drop.

Thanks in advance.

Thanks & Regards,
Vinod.C

Drag/Drop Operation - OLESetData Event Is Fired Before The Mouse Is Released
I have a Form which contains a Listview that displays files. I want to let users drag those files and drop them in an application or Windows Explorer.

I have implemented the following code:

Private Sub Listview1_OLESetData(Data As ComctlLib.DataObject, DataFormat As Integer)
Data.Files.Add "c:autoexec.bat", 1
End Sub

Private Sub Listview1_OLEStartDrag(Data As ComctlLib.DataObject, AllowedEffects As Long)
Data.SetData , vbCFFiles
AllowedEffects = vbDropEffectCopy
End Sub

As my attached Project demonstrates, if you drag an item from the Listview to Windows Explorer then OLESetData event is fired before the item is dropped in Explorer. In fact OLESetData is fired as soon as Drag enters Explorer window.

Does anyone know why this is happening as all the documentation says that the event will only be fired when the item is dropped on the target.

Regards,
Joginder

Drag And Drop Within A Database Filled Listbox
I have filled a listbox with the records from an access DB.

I need to drag and drop the items now appearing in the list and have that sort order reflected in the backend db so that other users screens will also refresh with the new order.

I have include a portion of the code below which does seems to return an eof error:

FromIndex = DragLV.Index
ToIndex = hitItem.Index

If FromIndex = ToIndex Then GoTo Ende 'If source and destination are the same

rsQuestion.Requery
FromID = DragLV.Text
ToID = hitItem.Text

'if the QuestionID has something in it search by qid
Dim strSearch As String
strSearch = "QuestionID = " & ToID
rsQuestion.MoveFirst
rsQuestion.Find strSearch

ToOrder = rsQuestion("OrderID")
ToAsked = rsQuestion("HasBeenAsked")

strSearch = "QuestionID = " & FromID
rsQuestion.MoveFirst
rsQuestion.Find strSearch

FromOrder = rsQuestion("OrderID")



If FromIndex > ToIndex Then
'dragging up
Do
rsQuestion.MovePrevious
SQLString = "UPDATE Question SET Question.OrderID= " & FromOrder
SQLString = SQLString & " WHERE (Question.QuestionID=" & rsQuestion("QuestionID") & ")"
cnn1.Execute SQLString
FromOrder = FromOrder - 1
Loop Until rsQuestion("QuestionID") = ToID
SQLString = "UPDATE Question SET Question.orderid= " & ToOrder
SQLString = SQLString & " WHERE (Question.QuestionID=" & FromID & ")"
cnn1.Execute SQLString
Else ' dragging down
Do
rsQuestion.MoveNext
SQLString = "UPDATE Question SET Question.OrderID= " & FromOrder
SQLString = SQLString & " WHERE (Question.QuestionID=" & rsQuestion("QuestionID") & ")"
cnn1.Execute SQLString, dbFailOnError
FromOrder = FromOrder + 1
Loop Until rsQuestion("QuestionID") = ToID
SQLString = "UPDATE Question SET Question.orderid= " & ToOrder
SQLString = SQLString & " WHERE (Question.QuestionID=" & FromID & ")"
cnn1.Execute SQLString
End If

lstQuestions.ListItems.Clear
LoadList 'Calls function to reload the listbox from the database
rsQuestion.Requery

Drag And Drop From Windows Explorer To Listbox
Hi I would like to know how can I drag and drop from windows explorer to a listbox.
I looked on the internet and tried some of the methods but it didn’t work and had no success.
Perhaps someone can help me out, and I would rather use the OLE method rather then the API Method.

Thanks for your time and I look forward to your reply.

Drag And Drop From Windows Explorer To Listbox
Hi I would like to know how can I drag and drop from windows explorer to a listbox.
I looked on the internet and tried some of the methods but it didn’t work and had no success.
Perhaps someone can help me out, and I would rather use the OLE method rather then the API Method.

Thanks for your time and I look forward to your reply.

Listbox Multiselect Drag && Drop In Excel
I've finally gotten the code down to drag an item from one list box and drop it into another listbox, but only for one item at a time. The list boxes are on a user form and I am using Excel 2002.

Can anyone help with how to select multiple items in ListBox1, drag them to and drop them into ListBox2?

Any suggestions are greatly appreciated.

It seems the DataObject used in the sample code provided by Excel Help [see code below] to carry info from one listbox to the next is limited to one item at a time. Can something else be used in its place that doesn't have this limitation?

Code:
Private Sub ListBox2_BeforeDragOver(ByVal Cancel As _
    MSForms.ReturnBoolean, ByVal Data As _
    MSForms.DataObject, ByVal X As Single, _
    ByVal Y As Single, ByVal DragState As Long, _
    ByVal Effect As MSForms.ReturnEffect, _
    ByVal Shift As Integer)
    Cancel = True
    Effect = 1
End Sub

Private Sub ListBox2_BeforeDropOrPaste(ByVal _
    Cancel As MSForms.ReturnBoolean, _
    ByVal Action As Long, ByVal Data As _
    MSForms.DataObject, ByVal X As Single, _
    ByVal Y As Single, ByVal Effect As _
    MSForms.ReturnEffect, ByVal Shift As Integer)
    Cancel = True
    Effect = 1
    ListBox2.AddItem Data.GetText
End Sub

Private Sub ListBox1_MouseMove(ByVal Button As _
     Integer, ByVal Shift As Integer, ByVal X As _
     Single, ByVal Y As Single)
    Dim MyDataObject As DataObject
    If Button = 1 Then
        Set MyDataObject = New DataObject
        Dim Effect As Integer
        MyDataObject.SetText ListBox1.Value
        Effect = MyDataObject.StartDrag
    End If
End Sub

Private Sub UserForm_Initialize()
    For i = 1 To 10
        ListBox1.AddItem "Choice " _
            & (ListBox1.ListCount + 1)
    Next i
End Sub




Edited by - doofusboy on 8/20/2007 6:16:07 AM

Drag And Drop To Reorder Listbox Items??
All,

I am using VB6 with a standard listbox control. What I am trying to do is get drag and drop capability on the items within the list box so that users can re-order the items by dragging and dropping them to the new position.

I have found code on MSDN that works...sort of. It uses the DragDrop event that seems to set the DragMode to automatic in code. The drag and drop does work but it seems as an artifact of that, when I click and drag the item, rather than isolating to the selected item, the entire frame of the listbox becomes attached to the mouse cursor and is dragged as the mouse cursor is moved.

Additionally, it doesn't actually move the control, it just drags the frame with the mouse cursor, when the mouse button is released, the frame disappears and the item is rearranged in the list. I want to just have my defined cursor display, not the list box frame.

Anyone have any code or know how to easily rearrange list box items?

Thanks in advance,

-John

ListBox Item Drag && Drop And Line Select
Hi

Below is the code (obtained from this forum but I cant remember from who) that I use to move lines in a listbox up or down by dragging and dropping them.

Code:
Option Explicit

Dim sCurItem As String
Dim iLastIndex As Integer

Private Type POINTAPI
X As Long
Y As Long
End Type

Private Declare Function LBItemFromPt Lib "comctl32" _
(ByVal hwnd As Long, _
ByVal ptx As Long, _
ByVal pty As Long, _
ByVal bAutoScroll As Long) As Long

Private Declare Function ClientToScreen Lib "user32" _
(ByVal hwnd As Long, lpPoint As POINTAPI) As Long

Private Sub Form_Load()
With List1
.AddItem "Item1"
.AddItem "Item2"
.AddItem "Item3"
.AddItem "Item4"
.AddItem "Item5"
End With
End Sub

Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = vbRightButton Then
GoTo RBjump
Else
sCurItem = List1.List(List1.ListIndex)
iLastIndex = List1.ListIndex
End If

RBjump:
End Sub

Private Sub List1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim iCurIndex As Long
Dim pt As POINTAPI

If Button = vbRightButton Then
GoTo RBjump
Else
pt.X = X Screen.TwipsPerPixelX
pt.Y = Y Screen.TwipsPerPixelY

Call ClientToScreen(List1.hwnd, pt)

iCurIndex = LBItemFromPt(List1.hwnd, pt.X, pt.Y, False)

If iCurIndex > -1 Then
List1.RemoveItem iLastIndex
List1.AddItem sCurItem, iCurIndex
End If
End If
RBjump:
End Sub


The code works great for moving lines about but I also need to be able to highlight a line just by clicking on a line, the above code wont let me click and highlight a line, cant work out why.

Any ideas.

Thanks.

Drag And Drop Windows File Icons Into Listbox
Has anyone done this in VB6? I want to be able to drag (a) file icon(s) from anywhere on the windows desktop to a listbox on a vb6 app form and have the full filepath(s) appear in the listbox.

If anyone can point me to some example code or suggest an approach I would be grateful.

Thanks!

How To Drag And Drop From Outlook Into Vb Listbox, Textbox Or Listview
Hi,
URGENT!!!!
Can someone help in how to drag and drop an item from outlook like email into vb listbox or textbox using vb programming with keeping all item's or email's properties in vb so I can access all the item's or email's properties fom vb. Can you give me a hint, code, or website to read. Any help is appreciated. Thanks in advance.

Drag And Drop An Item From Outlook Into Vb Listbox Or Textbox
Hi,
URGENT!!!!
Can someone help in how to drag and drop an item from outlook like email into vb listbox or textbox using vb programming with keeping all item's or email's properties in vb so I can access all the item's or email's properties fom vb. Can you give me a hint, code, or website to read. Any help is appreciated. Thanks in advance.

Listbox To Text Box Drag And Drop Not Working Properly
Hello World,

I am still a little baby in the world of .net and am starting to learn how to walk, below is my latest issue that has me stumped. What I have accomplished with the code is that I am able to drag from a listbox "LboxNewJobs" to a textbox "txtMonday" successfully, but it will only select the first item in the index "0". What I am trying to succeed in is to be able to single select any particular item the listbox and drag it over to the textbox. So my code partly works and I am probably missing something profoundly simple.

All help is greatly appreciated.

Ryan
newbie101

Here's my drag and drop code
Private Sub LBoxNewJobs_MouseMove(ByVal sender As Object, _
 ByVal e As System.Windows.Forms.MouseEventArgs) Handles LboxNewJobs.MouseDown
       
'I Think this is where I am having my problems at:
 LboxNewJobs.DoDragDrop(LboxNewJobs.GetItemText(LboxNewJobs.SelectedItem).ToString, DragDropEffects.Copy)

   End Sub

Private Sub txtMonday_DragEnter(ByVal Sender As System.Object, _
ByVal e As System.Windows.Forms.DragEventArgs) Handles TxtMonday.DragEnter

        e.Effect = DragDropEffects.All

End Sub

Private Sub txtMonday_DragDrop(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.DragEventArgs) Handles TxtMonday.DragDrop

        TxtMonday.SelectedText = e.Data.GetData(DataFormats.Text).ToString


End Sub

Drag From ListBox And Drop Into Another ListBox
Am having a complete mental block here on drag-and-drop.

Trying to copy selected items from a ListBox that has it's .MultiSelect property set to 2-Extended into another ListBox.

When more than one item is selected, I can only get the last item to drop into the second ListBox.

Any help at all appreciated.

Drag From ListBox And Drop Into Another ListBox
Am having a complete mental block here on drag-and-drop.

Trying to copy selected items from a ListBox that has it's .MultiSelect property set to 2-Extended into another ListBox.

When more than one item is selected, I can only get the last item to drop into the second ListBox.

Any help at all appreciated.

Drag Drop LIstbox To Listbox
How would I drag an item in a listbox and drop it into another listbox

working on a buddylist for vbbrowser

Drag And Drop From Listbox To Listbox? Help Please!
hi guys. joined 'cause i'm in a bit of a pickle.

i have a listbox that loads an array, let's say it loads folders, so that it has "Folder 1", "Folder 2", "Folder 3" and so on. now when you click on one of those folders, on another listbox, the program loads the information, which would be names of people. so if you click on "Folder 2" and the second listbox shows "Mary", "John", "Edward", etc.

i'm trying to find a way to make it so that I can click on "Edward" and drag him across to the first listbox and drop his name to another folder, thereby moving his information from folder to folder without the user having to retype everything from scratch.

now, I can get the coding done for the saving and stuff no problem, i'm just having a hard time with the drag and drop.

is there a way so that you can literally drag the "Edwards" field (meaning as you drag it it comes out of the listbox)?

that is not crucial though, i already have that part working by using a drag icon that simulates the effect, and i could ultimately just use that. however, what is becoming more and more challenging and in turn is making the code so far uglier and uglier, is determining which of the fields of the folder list box it would drop the file into...how does it know which item it is over as you drop the drag?!

in other words, how do i determine which of the items of the listbox the dragged item is being "dropped" into?

thanks a lot for the help and I hope that wasn't as confusing as it sounds to me...i'm tired!

Drag From ListBox And Drop Into Another ListBox
Am having a complete mental block here on drag-and-drop.

Trying to copy selected items from a ListBox that has it's .MultiSelect property set to 2-Extended into another ListBox.

When more than one item is selected, I can only get the last item to drop into the second ListBox.

Any help at all appreciated.

Drag/drop Files From Explorer To Any Textbox, Combo Or Listbox...
In order to fill a texbox, combo box or listbox with files dropped from explorer you need to subclass it and handle the WM_DROPFILES message. The attached module can be dropped in to any project to enable you to have drag-drop files from explorer more easily.

usage:

Code:
Private Sub Form_Load()

Call DragDropFiles.EnableDragDrop(Me.List1)

End Sub

Drag And Drop , Add Or Remove Listbox Using Set Customize Toolbar At Runtime
Dear experts

I want to use user customise toolbar at the runtime add or remove and drag and drop sp..............

like this picture

Can you give me sample code and with attach

Best regards
P.SASIKUMAR

Drag And Drop , Add Or Remove Listbox Using Set User Toobar At Runtime
Dear experts

I want to use user toolbar at the runtime add or remove and drag and drop

like this

Drag/Drop Of A PictureBox, Keeping The Image Visible During Drag
Haya!

As the title says, I need to do what seems to me should be fairly simple. I have a number of pictureboxes each filled with a static image. I would like to add the ability for a user to drag the picturebox on to ANOTHER picturebox (this one holds a image currently selected by dropdown list). Upon drop, the box and associated dropdown box should be changed accordingly.

I only need a single integer to transfer with the drag/drop operation, as each image is keyed to a number.

Now, I am not all that familier with Drag Drop at all, much less with maintaining the image while being dragged... If anyone could point me to a good tutorial, I would be much appreciative.

Thanks!

Dave Borneman

OLE Drag && Drop (Drag From My App To Windows Explorer)
How can I set this up:
My app will display a listview in large- or small- icon format. These icons will represent files. I would like the user to be able to drag one or more of the icons from the listview and drop them into an Explorer folder (effectively, my app would be copying these files to the desired folder). I know it's probably not rocket science, but I haven't done this before. TIA for your help...

WebBrowser Drag && Drop (get Drop Filename)?
I have Form with 2 WebBrowser's ( WebBrowser1 & WebBrowser2 )

WebBrowser1 is displaying graphic images that can be dragged and dropped into WebBrowser2 but how do I find the name of the file I dragged and dropped?

I also have another related questions.

I can select multiple images in WebBrowser1 but I cannot drop them into WebBrowser2 (only one image at a time), what type of container should I use to drop multiple images into? I know it can be done because I can drag and drop the multiple images into FrontPage.

Your cryptic clues would be enormously helpful to me

Copyright © 2005-08 www.BigResource.com, All rights reserved