[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

ListBox,OwnerDrawVariable...MeasureItem is called only once?

Özden Irmak

10/11/2004 6:17:00 PM

Hello,

I've derived from ListBox control to create a special control. This
control's DrawItem property is OwnerDrawVariable. When the items are get
drawn, OnMeasureItem is called once but only once. No matter you resize the
control, etc. will not cause this event to be re-called again.

I have to recalculate the Item heights when the width of the control is
changed but this seems not to be possible? Is this a bug? Anyworkaround?

Thanks in advance,

Özden


2 Answers

Özden Irmak

10/11/2004 8:25:00 PM

0

Sorry, wrong newsgroup...

Özden

"&#214;zden Irmak" <ozdenirmakatisnetdotnetdottr> wrote in message
news:ub7Uf67rEHA.2008@TK2MSFTNGP12.phx.gbl...
> Hello,
>
> I''ve derived from ListBox control to create a special control. This
> control''s DrawItem property is OwnerDrawVariable. When the items are get
> drawn, OnMeasureItem is called once but only once. No matter you resize
> the control, etc. will not cause this event to be re-called again.
>
> I have to recalculate the Item heights when the width of the control is
> changed but this seems not to be possible? Is this a bug? Anyworkaround?
>
> Thanks in advance,
>
> &#214;zden
>


Bob Powell

10/12/2004 12:01:00 AM

0

It''ll get called if you force the recreation of the handle.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdipl...

The GDI+ FAQ RSS feed: http://www.bobpowell.net/f...
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tips...
Bob''s Blog: http://bobpowelldotnet.blogspot.co...






"&#214;zden Irmak" <ozdenirmakatisnetdotnetdottr> wrote in message
news:ub7Uf67rEHA.2008@TK2MSFTNGP12.phx.gbl...
> Hello,
>
> I''ve derived from ListBox control to create a special control. This
> control''s DrawItem property is OwnerDrawVariable. When the items are get
> drawn, OnMeasureItem is called once but only once. No matter you resize
the
> control, etc. will not cause this event to be re-called again.
>
> I have to recalculate the Item heights when the width of the control is
> changed but this seems not to be possible? Is this a bug? Anyworkaround?
>
> Thanks in advance,
>
> &#214;zden
>
>