Hi there,
ListView.Sorting Property = SortOrder.None (default)?
I've tried that but it doesn't seem to have the desired effect, each of
my listview items text property is set to it's index, this occurs every time
an item is scrolled into view. I do not want any other text other than the
force index of the item to be displayed.
So when the listview attempts to sort the items I end up with the
obvious,
0, 1, 10, 100, 101, 102.... and so on and so fourth and such like.
I've just come across a method where you send the message
LVM_SETITEMPOSITION to the listview and the item should go to the position
that you desire, and as I have AutoArrange set to True it should then be
tidied up. But unfortunately I only seem to be able to get it to go to
index 0 or 1, probably due to some issue with my routines....
'~~~~~~~~~~~~~~
<DllImport("user32.dll", EntryPoint:="SendMessageA")> _
Public Shared Function sendMessage(ByVal iHandle As IntPtr, ByVal iMessage
As Integer, ByVal iWParam As Integer, ByVal iLParam As Long) As Integer
End Function
<DllImport("kernel32.dll", EntryPoint:="RtlMoveMemory")> _
Public Shared Sub MoveMemory(ByVal iDestination As Integer, ByVal iSource As
Object, ByVal iLength As Integer)
End Sub
'Macros
Public Shared Function MAKELONG(ByVal iLow As Integer, ByVal iHigh As
Integer) As Long
Return (LOWORD(iLow) Or (&H10000 * LOWORD(iHigh)))
End Function
Public Shared Function LOWORD(ByVal iValue As Long) As Integer
Dim pIntRetVal As Integer
Call MoveMemory(pIntRetVal, iValue, 2)
Return (pIntRetVal)
End Function
'~~~~~~~~~~~~~~
Call Win32Utility.sendMessage(<listview handle>, LVW_SETITEMPOSITION, <item
index>, MAKELONG(<destination X>, <destination Y>))
'~~~~~~~~~~~~~~
^ Presumably this would do as I'm hoping and move the position of the
item to whereever I desire, but it doesn't seem to be doing that, any ideas
on what I might be doing wrong??
Nick.