PDA

View Full Version : Sorting in the Listview



Nader
02-26-2008, 06:18 PM
Dim i As Integer ' To painting the word by color
For i = 1 To ListView1.ListItems.Count
If ListView1.ListItems.Item(i).Text = "red" Then
ListView1.ListItems.Item(i).ForeColor = RGB(200, 50, 20)
End If
Next i

Dim id As Integer ' to sort the word according the letters
For id = 1 To ListView1.ListItems.Count
If ListView1.ListItems.Item(id).Text = "red" Then
ListView1.Sorted = True
End If
Next id

this sort the match words in the middle of the listview according of the arrange of the letters.
I want to sort the word in the first of list view.