Code:Option Explicit 'Here 's one way that you can let users drag items from one list 'and drop them in another one. 'Create two lists (list1, list2)and a text box (text1) Private Sub Form_Load() ' Set the visible property of text1 to false Text1.Visible = False 'Add items to list1 List1.AddItem "This" List1.AddItem "Example" List1.AddItem "Comes To You" List1.AddItem "Compliments of someone and me." List1.AddItem "somewhere on planet earth" List1.AddItem "Enjoy!" ' End Sub 'In the mouseDown event of the list list1 put the following code: Private Sub list1_MouseDown(Button As Integer, _ Shift As Integer, X As Single, y As Single) Dim z As Integer z = List1.ListIndex 'do the drag Text1.Text = List1.Text Text1.Top = y + List1.Top Text1.Left = X + List1.Left Text1.Drag 'remove item from list1 and refresh listcount List1.RemoveItem (z) List1.Refresh 'if empty disable the box as it will result in error's on empty If List1.ListCount = 0 Then List1.Enabled = False End If ' End Sub 'In the dragDrop event of the list list2 put the following code: Private Sub list2_DragDrop(Source As Control, X As Single, y As Single) ' List2.AddItem Text1.Text End Sub 'Now you can drag items from list1 and drop them in list2.




Reply With Quote