Sean
Jan 12th, 2000, 12:12 AM
How do I drag an item from a list box and place it in a text box say?
Is this possible?
Any help would be appreciated.
Thanks Sean
Aaron Young
Jan 12th, 2000, 03:31 AM
Add a Textbox and a Listbox to a Form..
Private Sub Form_Load()
Dim iIndex As Integer
For iIndex = 1 To 10
List1.AddItem "Item " & iIndex
Next
List1.DragIcon = LoadPicture("..\Common\Graphics\Icons\DragDrop\Drag1pg.ico")
List1.DragMode = vbManual
End Sub
Private Sub List1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then List1.Drag vbBeginDrag
End Sub
Private Sub List1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
List1.Drag vbEndDrag
End Sub
Private Sub Text1_DragDrop(Source As Control, X As Single, Y As Single)
If TypeOf Source Is ListBox Then
Text1 = Source.List(Source.ListIndex)
End If
End Sub
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
ajyoung@pressenter.com