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.