all groups > dotnet compact framework > january 2007 >
You're in the

dotnet compact framework

group:

Listview set spacing in Compact Framework cannot work


Listview set spacing in Compact Framework cannot work jason.yfho NO[at]SPAM gmail.com
1/19/2007 8:19:00 AM
dotnet compact framework: 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
Re: Listview set spacing in Compact Framework cannot work ctacke/
1/19/2007 11:25:51 AM
What does SendMEssage return? What does GetLastError return? Doing some
error checking usually is the first step in debugging.


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--


[quoted text, click to view]

AddThis Social Bookmark Button