can somebody explain how to use the OLEDragDrop deal??
Like If I want to select text from a textbox and then drag it onto a listbox and have the selected text be added to the listbox, how does I does that?
Printable View
can somebody explain how to use the OLEDragDrop deal??
Like If I want to select text from a textbox and then drag it onto a listbox and have the selected text be added to the listbox, how does I does that?
I Think this'll get ya started...
put a listbox and a textbox on ya form and paste this code:
Code:Private Sub List1_DragDrop(Source As Control, X As Single, Y As Single)
If Source = Text1 Then List1.AddItem Text1 'Drop it.
End Sub
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1.SelStart = 0 'this is optional, just to select the text in the textbox
Text1.SelLength = Len((Text1)) 'this is optional, just to select the text in the textbox
Text1.Drag vbBeginDrag 'Drag it.
End Sub
Hope it helps ya a bit
cool, thanks