|
|
Title | Click on ListView columns to order a list |
Keywords | ListView, sort, column |
Categories | Controls, Algorithms |
|
|
In the ListView control's ColumnClick event handler, set the SortKey property to indicate the sort column.
|
|
Private Sub ListView1_ColumnClick(ByVal ColumnHeader As _
MSComctlLib.ColumnHeader)
ListView1.SortKey = ColumnHeader.Index - 1
End Sub
|
|
This program also shows how to make the ListView display data in different formats: icon, small icon, list, or report.
|
|
Private Sub mnuViewChoice_Click(Index As Integer)
Dim i As Integer
' Display the selected view style.
ListView1.View = Index
' Check this menu item.
For i = 0 To 3
If i = Index Then
mnuViewChoice(i).Checked = True
Else
mnuViewChoice(i).Checked = False
End If
Next i
End Sub
|
|
|
|
|
|