473,509 Members | 8,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Listview set spacing in Compact Framework cannot work

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

Jan 19 '07 #1
1 1844
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
--
<ja********@gmail.comwrote in message
news:11**********************@l53g2000cwa.googlegr oups.com...
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

Jan 19 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2835
by: Duncan | last post by:
I am using the evaluation version of CE.NET 4.1. I had also installed the release version of the Compact Framework. I uninstalled the CE.NET 4.1, and then realized I needed it again and...
1
2494
by: Asad Khan | last post by:
Hi, I have Visual Studio 2002 Enterprise Architecture Edition. I was wondering if anyone has any information on how I can develop applications for .Net Compact Framework using this IDE. I've heard...
5
1996
by: Adam | last post by:
Hi, How do i listen for windows messages in c# on compact.net? I have a window containing an instantiation of the HTML viewer control, which is a child of the main form. As the compact...
1
1505
by: Poewood | last post by:
when I initialize a ListView object in compact framework the listviews item do not show up when I set the "View" to "Detail". this is the problem: listViewItem4.Text = "Test";...
1
2339
by: davebrennan1975 | last post by:
I have a WinForms application that displays multiple choice questions (the choices are actually radio buttons with Appearance=Button). Depending on the question, I may have 3, 4, or 5 choices to...
1
4511
by: yxq | last post by:
Hi Can the listview itmes's spacing(horizontal and Vertical spacing) be changed? Thanks
5
3316
by: bob | last post by:
Hi Using 2003 - targeting the compact framework (c#), but would like to do most development using the full.net (manually leaving out stuff not in the compact framework). Q. Trying to find a...
1
2279
by: Steamboat | last post by:
I have read two excellent articles on how to subclass .NET controls so that you can hook into the control’s WndProc, which is very helpful since you cannot access the WndProc directly for .NET...
3
2613
by: Greg | last post by:
Hello all, I am looking to download an image from a website from within a compact framework pda app. I have tried everything I could find and thus I turn to you. Any help or suggestions would be...
0
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7416
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
5062
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4732
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3218
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1571
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
443
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.