Groups | Blog | Home
all groups > c# > september 2004 >

c# : Custom ComboBox


Nicholas Paldino [.NET/C# MVP]
9/13/2004 3:27:47 PM
Mohammad,

When you set the DrawMode to OwnerDrawFixed, I believe that the event
will fire the DrawItem and the MeasureItem events, which you hook up to and
then provide painting code in there.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

[quoted text, click to view]

Mohammad-Reza
9/13/2004 10:23:34 PM
Hi
I want to design a combo box.
I open a new UserControl project and inherits from
System.Windows.Forms.ComboBox
and try to override OnPaint event and set the DrawMode to OwnerDrawFixed.
But when I compile the project the interface did not change.
How can I override the OnPaint of this component.
Thanks in advance.

Mohammad-Reza
9/14/2004 9:11:19 AM
MeasureItem and DrawItem both are for drop down items and I want to change
the user interface of the control.


"Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote in
message news:uJ9IXfcmEHA.2680@TK2MSFTNGP15.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button