PC Review


Reply
Thread Tools Rate Thread

ComboBox Custom OnPaint

 
 
ian_jacobsen@hotmail.com
Guest
Posts: n/a
 
      12th Jul 2006
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;

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TextBox with custom OnPaint =?Utf-8?B?cnBhcnJlbGxh?= Microsoft Dot NET Compact Framework 0 17th Aug 2007 01:58 AM
Can I do this? VB.Net, XML, Custom Controls, Drawing, OnPaint JimBob Microsoft VB .NET 0 11th Aug 2006 03:57 PM
Custom Textbox and onPaint Ferdinand Zaubzer Microsoft C# .NET 0 3rd Aug 2006 03:21 PM
Combobox OnPaint method Chris Microsoft VB .NET 1 21st Jul 2005 12:31 AM
Trick for use of OnPaint for TextBox/ComboBox on Compact ? Mark Johnson Microsoft Dot NET Compact Framework 3 20th Mar 2004 04:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:42 AM.