List view items Order

  • Thread starter Thread starter S Shulman
  • Start date Start date
S

S Shulman

Hi all

I need to know the actual order of the items in the listview control even
after the user clicked the column header to re-arrange the order

Thank you,
Shmuel
 
Public Shared Function ListViewGetColumnOrder(ByVal lvw As
ListView) As Integer()
Dim len As Integer = lvw.Columns.Count
Dim inta As Integer() = New Integer(len - 1) {}
SendMessage(lvw.Handle, LVM_GETCOLUMNORDERARRAY, len, inta)
Return inta
End Function

Public Const LVM_FIRST As Integer = &H1000
Public Const LVM_GETCOLUMNORDERARRAY As Integer = (LVM_FIRST + 59)

Public Declare Auto Function SendMessage Lib "User32" ( _
ByVal hWnd As IntPtr, _
ByVal msg As Integer, _
ByVal wParam As Integer, _
ByVal lParam As Integer()) As Boolean


HTH,

Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top