473,386 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

ComboBox Custom OnPaint

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;

Jul 12 '06 #1
0 1946

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Richard Bateman | last post by:
I need to make a combo box that doesn't look like the standard windows controls. I thought that extending the combobox control would make the most sense, so I could draw it myself. However,...
2
by: Mohammad-Reza | last post by:
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...
5
by: malcolm | last post by:
I'm trying to make a combo box custom control (Windows Forms .NET 1.1 c#) that can behave like a label programatically at run time. This is actually a strong feature request by our customers. I...
3
by: Tim | last post by:
Dear All, I have spend a number of hours attempting to find some answers about how to remove the 3D BorderStyle within a combobox and have come to the conclusion that the simplest method is to...
1
by: Chris | last post by:
1. I was trying to use a flatcombo box. I found code on codeproject that did what I needed. They used the following code in the WndProc overridden procedure. Dim g As Graphics =...
4
by: Vish | last post by:
Hi, I need to make the text on a combobox that is disabled to be drawn with a black color. I was not able to find any help on this online. The drawItem seems to apply only for the dropdpwn...
6
by: ian_jacobsen | last post by:
I have a control that is derived from the standard ComboBox. I want to lock or suppress the DropDown when the arrow button is clicked without disabling the control. This is related to another...
6
by: Nathan Laff | last post by:
Why when I inherit a ComboBox and make no code changes, when I set the new control DropDownStyle to dropDownList it appears different than the standard ComboBox control on Vista? In Windows...
10
by: Academia | last post by:
I'm making my own ComboBox and would like the DropDown button to look like the system combo box. Do you know the Font for the "v" that is used in the regular combobox. Is that the letter vee...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.