Listview set spacing in Compact Framework cannot work

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
 
G

Guest

What does SendMEssage return? What does GetLastError return? Doing some
error checking usually is the first step in debugging.
 

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

Top