ComboBox Custom OnPaint

I

ian_jacobsen

I have a control that is derived from the standard ComboBox. I have an
override for the OnPaint method that paints a border, drop down arrow
button, background, and foreground. The only problem is that something
(some other event/subcontrol) is drawing a black text box with a large
font over top of the text box region of the combo box control.

I am drawing a background in my OnPaint event, and it is being draw on
top of. I can see that the background is drawn because there is a
border around the text box region. My code looks like the following:

protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);

DrawBorder();
DrawBackground();
DrawArrowButton();
DrawForegroundText();
}

What am I missing here??? By the way, this control works just fine if
the DropDownStyle is set to DropDownList, however I'm need it to work
as a DropDown (being able to edit the text box).

--Ian;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top