Listview set spacing in Compact Framework cannot work

  • Thread starter Thread starter jason.yfho
  • Start date Start date
J

jason.yfho

Hi all,

I want to have less white spacing in the listview of my Compact
Framework application. I tried to set it using SendMessage, but there
is no change to the listview. Any idea? Below is my code. Thank you so
much!!

Public Const LVM_FIRST = &H1000
Public Const LVM_SETICONSPACING = (&H1000 + 53)

<DllImport("coredll", SetLastError:=True)> _
Private Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal msg As
_
UInt32, ByVal wParam As UInt32, ByVal lParam As Integer) As IntPtr
End Function

Private Function MakeLong(ByVal nLoWord As Int16, ByVal nHiWord As
Int16) As Int32
'places two integer values into the hiword and loword
MakeLong = nHiWord * &H10000 + nLoWord
End Function

Private Sub ListViewIconSpacingInit()
SendMessage(ListView1.Handle, LVM_SETICONSPACING, 0, MakeLong(130,
114))
End Sub

Rgds,
Jason
 
What does SendMEssage return? What does GetLastError return? Doing some
error checking usually is the first step in debugging.
 
Back
Top