Spotnick2
October 27th, 1999, 02:16 PM
Is there an easy way to sort in REVERSE order a Combo Box?
---
Nicolas LeBlanc
Software Engineer
Ordiplan Inc.
---
Nicolas LeBlanc
Software Engineer
Ordiplan Inc.
|
Click to See Complete Forum and Search --> : Reverse sort order for comboboxes? Spotnick2 October 27th, 1999, 02:16 PM Is there an easy way to sort in REVERSE order a Combo Box? --- Nicolas LeBlanc Software Engineer Ordiplan Inc. Lothar Haensler October 28th, 1999, 03:19 AM 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. Ravi Kiran October 28th, 1999, 03:46 AM 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 Spotnick2 October 28th, 1999, 08:45 AM 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. codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |