List Box Control Question (Not Listview control)
Can someone show me how to drag and drop a list item
from one position to another in the same list box and have the item list automatically reorder itself?
Thanx!
JC
[email protected]
Printable View
List Box Control Question (Not Listview control)
Can someone show me how to drag and drop a list item
from one position to another in the same list box and have the item list automatically reorder itself?
Thanx!
JC
[email protected]
This project Requires a Listbox called List1. Set List1's OLEDragMode to 1-Automatic, OLEDropMode to 1-Manual, and Sorted to True.
Code:Dim Temp As String
Private Sub Form_Load()
List1.AddItem "abba"
List1.AddItem "yabba"
List1.AddItem "babba"
List1.AddItem "dabba"
List1.AddItem "nabba"
List1.AddItem "habba"
End Sub
Private Sub List1_OLECompleteDrag(Effect As Long)
List1.AddItem Temp
End Sub
Private Sub List1_OLEStartDrag(Data As DataObject, AllowedEffects As Long)
Temp = List1.List(List1.ListIndex)
End Sub
Try this, it worked for me.
http://www.mvps.org/ccrp/download/ccrpdownloads.htm
Down the "draglist" control and run it in your VB.