|
-
Feb 17th, 2000, 10:36 PM
#1
Thread Starter
New Member
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.
-
Feb 17th, 2000, 10:50 PM
#2
Lively Member
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
-
Feb 18th, 2000, 01:44 AM
#3
Addicted Member
"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.
-
Feb 18th, 2000, 12:38 PM
#4
Thread Starter
New Member
I don't understand why it doesn't support the sorted property during runtime.
Anyhow thank you Rober for your help.
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
|