(See attachment)
I need help sorting items inside a listbox, the problem is, i'm using columns; so i don't know the algorithm if i want to sort it like this :
See the combo box in my program?
If "A" is selected, i want the items to be sorted based the values of A, descending down from the biggest number to smallest number, and the same applies the other letters.
ex :
A B C D
3 2 8 5
6 5 4 2
8 6 3 2
7 5 7 5
4 7 4 8
8 6 4 0
Select "A"
A B C D
8 6 3 2
8 6 4 0
7 5 7 5
6 5 4 2
4 7 4 8
3 2 8 5
Select "B"
A B C D
4 7 4 8
8 6 3 2
8 6 4 0
7 5 7 5
6 5 4 2
3 2 8 5
Select "C"
A B C D
3 2 8 5
7 5 7 5
8 6 4 0
6 5 4 2
4 7 4 8
8 6 3 2
select "D"
A B C D
4 7 4 8
7 5 7 5
3 2 8 5
8 6 3 2
6 5 4 2
8 6 4 0
(these numbers are just an example, they're not in the prog. )
Thx in advance.
Last edited by Deny Winarto; Apr 22nd, 2005 at 06:16 PM.