|
-
Nov 22nd, 1999, 11:28 PM
#1
Thread Starter
New Member
When a listbox's Multiselect property is set to Extended how do you drag multiple items? If you start moving with the mouse button down, you just select more entries.
-
Nov 23rd, 1999, 12:08 PM
#2
Try this example I put together using 2 Listboxes.. (Make sure the DragMode is Manual)..
Code:
Private Sub Form_Load()
Dim iIndex As Integer
For iIndex = 1 To 10
List1.AddItem "Item " & iIndex
Next
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 List2_DragDrop(Source As Control, X As Single, Y As Single)
Dim iIndex As Integer
If TypeOf Source Is ListBox Then
List2.Clear
For iIndex = 0 To Source.ListCount - 1
If Source.Selected(iIndex) Then List2.AddItem Source.List(iIndex)
Next
End If
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Nov 23rd, 1999, 12:22 PM
#3
Thread Starter
New Member
I was trying to duplicate the functionality of explorer, where you could select a bunch of items from a list, let go of the mouse, then mousedown on one of the selected items and they would all be dragged.
Thanks.
Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|