• Welcome to PlanetSquires Forums.
 

Listview sort

Started by Petrus Vorster, July 21, 2023, 09:35:38 AM

Previous topic - Next topic

Petrus Vorster

Hi All

I used some code from I think Richard Kelly to sort contents of a listview in Powerbasic.
Do we have something like that in Freebasic/Winfbe?

-Regards,
Peter
-Regards
Peter

philbar

Hi Peter,

These listviews are pretty darn smart. With the ColumnClick event enabled:

Function frmMain_ListView1_ColumnClick( ByRef sender As wfxListView, ByRef e As EventArgs ) As LRESULT
   dim as long ncol = e.ListViewColumn
  
   frmmain.ListView1.Items.SortByColumn( ncol, true )    'False if you want descending order
   Function = 0
End Function

Phil

Petrus Vorster

My word. that simple?

 :-[

Thanks mate.

-Peter
-Regards
Peter