473,394 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 3678
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
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...

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.