Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to sort a list box in descending order

Status
Not open for further replies.

acjeff

Programmer
Aug 10, 2004
148
US
There is a sort property for list box in VB. When it's true, it sorts in asending order. Is there a simpliest way to sort it in descending order?

Jeff
 
What are you populating the list box from? A text file, database table, etc...?

Swi
 
A database table. Can be a thousand (or more) items into the list box.
 
Sorry, I made a confusion. There are 2 listboxes. Data is loaded from a database table into the first listbox in descending order. So far it's fine. Then users select data and add them to the second list box. At this point, I also want the second listbox in descending order no matter what sequence of data the users select. I don't want to use a looping code to sort the second box every time a new data is added because it will be slow. That's why I asked about descending sorting.
 
Look into the listview control. It has a sortorder property.

Swi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top