Owner Drawn ListBox never enter OnMeasureItem event!!

aewarnick

Well-known member
Joined
Jan 29, 2003
Messages
1,031
I didnt think I would have to post about this. All the articles on the net seemed straightforward about this.

No matter what I do, I cannot get the OnMeasureItem event to enter the block. I have tried both types of owner draws. I have also tried using an overridden event and a normal MeasureItem event. But nothing works.

If you need to see code, it is attatched. A .cs file.
 

Attachments

I got it figured out. Here is what happend. I made my own listbox class and set the Owner drawn property in the constructor of the code.

However, in the designer I had a list box that had its owerdrawn property set to something different.

Even though, the listbox on the designer was of type (My list box class) I had to set the ownerdrawn property to ownerdrawnvariable. Or better yet was normal and putting the ownerdrawn variable property in the derived listbox I made.

I do have a question though. Is it better or the same to override the events or to make new ones?
 
Last edited by a moderator:
Back
Top