Hey ,
I'm trying to drag a list box from one form to another . How can I acomplish this ?
[]P
Printable View
Hey ,
I'm trying to drag a list box from one form to another . How can I acomplish this ?
[]P
hmm.. you mean a whole control or duplicate just the contents to a listbox that already exists? (the last one would be not that easy I think, never done it)
Maybe something like this?
Code:'Form1:
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
List1.Drag vbBeginDrag
End Sub
'Form2:
Dim WithEvents lstCtl As VB.ListBox
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Set lstCtl = Controls.Add("VB.Listbox", "List1", Form2)
lstCtl.Visible = True
End Sub