Advertisement
Java_Volume1 Miscellaneous #89885

ListView Sort

This Is a handy code for sorting a ListView Box by whichever column header is clicked.

AI

Shrnutí AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Zdrojový kód
original-source
Private Sub ListView1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
  ListView1.Sorted = True
  
  If ListView1.SortKey = ColumnHeader.Index - 1 Then
    If ListView1.SortOrder = lvwAscending Then
      ListView1.SortOrder = lvwDescending
    Else
      ListView1.SortOrder = lvwAscending
    End If
    
  Else
    ListView1.SortOrder = lvwAscending
    ListView1.SortKey = ColumnHeader.Index - 1
    
  End If
  
End Sub
Původní komentáře (3)
Obnoveno z Wayback Machine