Simple little test:
When running, I move items up or down the listbox (reorder kinda thing) using the mouse (not a command button). After the first time moving something, the item BELOW the moved item is highlighted in the listbox. (rather it stay highlighted).
Second problem--if I simply click on an item, the item ABOVE what the one I clicked on is SORTA highighted---I mean, the dashed rectangle shows that item above as being 'selected'.
So, what I am looking for is how to have my selected listbox item remain highlighted, either when I move an item, OR when I simply click on one.
(the listbox in question in one of my programs might have up to a couple hundred entries. I currently use (but want to uncode (decode???)) a right-mouseclick on the listbox to move an item to the SECOND position in the list. But I would rather just 'go get an item' and move it where I want it with the mouse.)
Code:
Option ExplicitDim list1IndexA As String, list1IndexB As String, list1IndexC As String
Private Sub Form_Load()
List1.AddItem "SAM"
List1.AddItem "JOHN"
List1.AddItem "FRANK"
List1.AddItem "BILL"
List1.AddItem "JAMES"
End Sub
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
list1IndexA = List1.ListIndex
End Sub
Private Sub List1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
list1IndexB = List1.List(list1IndexA)
list1IndexC = List1.ListIndex
List1.RemoveItem (list1IndexA)
List1.AddItem list1IndexB, list1IndexC
End Sub
Second problem--if I simply click on an item, the item ABOVE what the one I clicked on is SORTA highighted---I mean, the dashed rectangle shows that item above as being 'selected'.
So, what I am looking for is how to have my selected listbox item remain highlighted, either when I move an item, OR when I simply click on one.
(the listbox in question in one of my programs might have up to a couple hundred entries. I currently use (but want to uncode (decode???)) a right-mouseclick on the listbox to move an item to the SECOND position in the list. But I would rather just 'go get an item' and move it where I want it with the mouse.)