473,473 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

LB_SETITEMHEIGHT example message

Can anyone provide a simple example on how to use a message with LB_SETITEMHEIGHT?

I need to resize a listBox 'cell' at runtime.

Thanks!
- Peder -
Nov 16 '05 #1
3 3684
Peder,
Can anyone provide a simple example on how to use a message with LB_SETITEMHEIGHT?


[DllImport("user32.dll", CharSet=CharSet.Auto)]
static extern IntPtr SendMessage(IntPtr hwnd, uint msg, IntPtr wParam,
IntPtr lParam);

const uint LB_SETITEMHEIGHT = 0x1a0;

....

SendMessage( theListBox.Handle, LB_SETITEMHEIGHT, (IntPtr)index,
(IntPtr)height );

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #2
you don't need to do this in .Net

you can use .Net built-in features to change control properties

what are you trying to do?
"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:ez**************@TK2MSFTNGP11.phx.gbl...
Peder,
Can anyone provide a simple example on how to use a message with
LB_SETITEMHEIGHT?
[DllImport("user32.dll", CharSet=CharSet.Auto)]
static extern IntPtr SendMessage(IntPtr hwnd, uint msg, IntPtr wParam,
IntPtr lParam);

const uint LB_SETITEMHEIGHT = 0x1a0;

...

SendMessage( theListBox.Handle, LB_SETITEMHEIGHT, (IntPtr)index,
(IntPtr)height );

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 16 '05 #3
I'm trying to change the ItemHeight of a single item (say item 3) in a
ListBox. AFAIK this cannot be done without either the message method
or deleting all Items and refilling the list. The control I'm making
is supposed to enlarge the item the mouse is hovering over. Clearly
the last method would be very inefficient for big lists. Hope this
clears things up. If there is a better .Net method, let me know. I
have searched high and low for one and noone seems to know.

Thanks!

- Peder -

"gary hitch" <ga************@drdc-rddc.gc.ca> wrote in message news:<10***************@viz.drev.dnd.ca>...
you don't need to do this in .Net

you can use .Net built-in features to change control properties

what are you trying to do?
"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:ez**************@TK2MSFTNGP11.phx.gbl...
Peder,
Can anyone provide a simple example on how to use a message with

LB_SETITEMHEIGHT?

[DllImport("user32.dll", CharSet=CharSet.Auto)]
static extern IntPtr SendMessage(IntPtr hwnd, uint msg, IntPtr wParam,
IntPtr lParam);

const uint LB_SETITEMHEIGHT = 0x1a0;

...

SendMessage( theListBox.Handle, LB_SETITEMHEIGHT, (IntPtr)index,
(IntPtr)height );

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 16 '05 #4

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

Similar topics

5
by: relaxedrob | last post by:
Hi All! I ran the following w3c example through my WSDL parser (SOA Editor from Cape Clear): http://www.w3.org/TR/wsdl#_rpcexample It told me that there were a bunch of erros about no...
13
by: vbmax | last post by:
Hi to all! I have to write the following program. 1.User inputs a number (example: 5) 2.Then (because he entered 5) he enters 5 times, each time different, 3-placed number (example: 134, 256,...
10
by: Bart Goeman | last post by:
Hi, I have a question about how to put redundant information in data structures, initialized at compile time. This is often necessary for performance reasons and can't be done at run time (data...
5
by: Serge | last post by:
Hi, I am having a thread hang problem in my c# code. The example on the website: http://csharp.web1000.com/ is a simplified version of my problem. You will see in the form that a...
2
by: Tash Robinson | last post by:
I have been searching and can not seem to find a good example of a working UDP client that listens, but does not block while waiting for data arrival. I am trying to write a client application...
3
by: Peder Y | last post by:
Can anyone provide a simple example on how to use a message with LB_SETITEMHEIGHT? I need to resize a listBox 'cell' at runtime. Thanks! - Peder -
6
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
3
by: BuddyWork | last post by:
Hello, Could someone please explain why the Socket.Send is slow to send to the same process it sending from. Eg. Process1 calls Socket.Send which sends to the same IP address and port, the...
3
by: Amie | last post by:
Hi, I would like to know if it's possible to display a message using python, if so can you show me an example. I saw something like:" from twisted.python import log log.msg" in some programs...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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.