|
-
October 27th, 1999, 02:16 PM
#1
Reverse sort order for comboboxes?
Is there an easy way to sort in REVERSE order a Combo Box?
---
Nicolas LeBlanc
Software Engineer
Ordiplan Inc.
-
October 28th, 1999, 03:19 AM
#2
Re: Reverse sort order for comboboxes?
AFAIK there is no way to change the sort order for a standard list or combobox.
If you are as lazy as I am, and don't want to write the code for sorting, you can use a hidden Listview and add your items to the listview. The listview supports sorting in ascending or descending order.
After sorting the listview you could then populate the combobox (Sorted=False) from the listview.
It's definitely less code then implementing a sort algorithm.
-
October 28th, 1999, 03:46 AM
#3
Re: Reverse sort order for comboboxes?
Quite often i do this, specially to sort strings. Use a hidden listbox...
BTW, listbox could be less resource mongering than a LV, me thinks.. unless ofcourse the no.of items are going to run out of integer bounds.
To sort in reverse order, copy the items bottom up.
For i = List.Listcount-1 to 0 step -1
RK
-
October 28th, 1999, 08:45 AM
#4
Re: Reverse sort order for comboboxes?
Yes, this is what I did. Actually there is a better way by "switching" them (takes 1/2 of the time), but I was wondering about a "natural" way, inside VB itself..
Since there isn't I did my own routine.
---
Nicolas LeBlanc
Software Engineer
Ordiplan Inc.
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
|