Link to home
Start Free TrialLog in
Avatar of nolram
nolram

asked on

Sorting using ListView Control in Visual Basic 6.0

hi
  i have a listview control in visual basic 6.0 with item values containing numbers ex. 1, 2, 3, 4, 5 , 10, 100, when i try to sort by clicking a column header the sort arrangement is like this 1,10,100,2,3,4,5. i just want to know know how would i make the sort like this 1,2,3,4,5,10,100 using listview control.

  thanks.
ASKER CERTIFIED SOLUTION
Avatar of Shiju S
Shiju S
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rcrux
rcrux

When you add a listitem make shure tha the number is inserted in string format with spaces on the left.

ListView1.ListItems(1).Text=format("1","@@@@@@")

@ should be repeated n times (as the max number chars you estimate needing)
the example abouve only woks for numbers between 0 and 999999.

hope to be of help
Avatar of nolram

ASKER

thanks so much.