-
I'm able to sort the listbox at design time. But I want it to be done at runtime. If I click a command button it should sort the listbox. When I tried to do "List1.sorted = true" it's coming with an error "Can't assign to read only property". Please help me.
-
Not very sophisticated, but simple and works:
Have to listboxes, one sorted and not visible, the other not sorted and visible. Add items to both listboxes. When user presses the sort button, clear unsorted (visible) listbox and get the items from the sorted listbox with following code (list1 visible, list2 not and sorted):
Code:
Dim i As Long
List1.Clear
For i = 0 To List2.ListCount - 1
List1.AddItem List2.List(i)
Next
Roger
-
"sorted" is read-only property. What I did is set sorted property to true at design time, then, every time you want to re-sort, just clear list and reload it.
-
I don't understand why it doesn't support the sorted property during runtime.
Anyhow thank you Rober for your help.