> I want to diplay strings of some objects in a LixtBox.
> Sometimes the text is longer than my ListBox and a horizontal scrollbar
> is displayed.
>
> Is it possible to get the ListBox to display the Text in multiple lines
> (per entry)?
Yes. Implement the ListBox.MeasureItem and ListBox.DrawItem events, and
set ListBox.DrawMode appropriately (OwnerDrawVariable). You'll need to
do the measuring and drawing yourself, unfortunately.
Check out Graphics.MeasureString and Graphics.DrawString methods and the
StringFormat class. It's not too difficult, and you have a lot of
flexibility. For example, you can put icons etc. in the listbox too, if
you like.
-- Barry

Signature
http://barrkel.blogspot.com/
Stefan P. - 09 Mar 2008 14:40 GMT
Hi Barry,
thanks. :)
I will try to do it this way.
Greetings Stefan
Barry Kelly schrieb:
>> I want to diplay strings of some objects in a LixtBox.
>> Sometimes the text is longer than my ListBox and a horizontal scrollbar
[quoted text clipped - 13 lines]
>
> -- Barry