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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SORT item in combobox

Status
Not open for further replies.

2009luca

Programmer
Jul 27, 2013
222
IT
here my items in combobox1:

01/01/2016 - 31/01/2016
01/09/2016 - 30/09/2016
01/03/2016 - 31/03/2016
01/04/2016 - 30/04/2016
01/05/2016 - 31/05/2016
01/07/2016 - 31/07/2016
01/08/2016 - 31/08/2016
01/02/2016 - 29/02/2016
01/10/2016 - 31/10/2016
01/11/2016 - 30/11/2016
01/12/2016 - 31/12/2016
01/04/2016 - 30/04/2016
01/06/2016 - 30/06/2016

i need to sort items from 01/12/2016 - 31/12/2016 to 01/01/2016 - 31/01/2016

how to?
 
You might like to see whether the idea I had for thread222-1695412, leveraging .NET's custom compare (in that thread for a listbox, but equally useable for a combobox), is of any use
 
>i need to sort items from 01/12/2016 - 31/12/2016 to 01/01/2016 - 31/01/2016

Apologies if I am being dim but I keep reading that and still cannot envisage what the sorted list is supposed to look like. Please post the list in the required sorted order.
 
01/12/2016 - 31/12/2016
01/11/2016 - 30/11/2016
...
01/03/2016 - 31/03/2016
01/02/2016 - 29/02/2016
01/01/2016 - 31/01/2016

 
Ah - well that looks like a pretty straightforward text sort - and VB6 combo boxes have a Sorted property, which should achieve the result without resorting to the code trick I suggested.
 
With respect that looks like a pretty straightforward reverse text sort
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top