473,505 Members | 13,925 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ComboBox DrawItem

hi-

when

private void theCombo_DrawItem(object sender,
System.Windows.Forms.DrawItemEventArgs e)

is called for a ComboBox how do I know when
the system is drawing the item that appears in
the top of the box? i want to change the border
for that item only.
thanks - fg

Nov 13 '05 #1
2 7014
Could you use something like:

private void theCombo_DrawItem(object sender,
System.Windows.Forms.DrawItemEventArgs e){
ComboBox cb = (ComboBox)sender;
object o = cb.Items[0];
/*... do stuff here with o ...*/
}

then cast that to whatever drawing type you're working with?
fragget <fr*****@home.com> wrote in message news:<uc********************************@4ax.com>. ..
hi-

when

private void theCombo_DrawItem(object sender,
System.Windows.Forms.DrawItemEventArgs e)

is called for a ComboBox how do I know when
the system is drawing the item that appears in
the top of the box? i want to change the border
for that item only.
thanks - fg

Nov 13 '05 #2
ill give it a shot and let u know how it goes
-----Original Message-----
Could you use something like:

private void theCombo_DrawItem(object sender,
System.Windows.Forms.DrawItemEventArgs e){
ComboBox cb = (ComboBox)sender;
object o = cb.Items[0];
/*... do stuff here with o ...*/
}

then cast that to whatever drawing type you're working with?

fragget <fr*****@home.com> wrote in message

news:<uc********************************@4ax.com>. ..
hi-

when

private void theCombo_DrawItem(object sender,
System.Windows.Forms.DrawItemEventArgs e)

is called for a ComboBox how do I know when
the system is drawing the item that appears in
the top of the box? i want to change the border
for that item only.
thanks - fg

.

Nov 13 '05 #3

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

Similar topics

4
9083
by: Beeeeeeeeeeeeves | last post by:
I have an ownerdrawn combo box which I am drawing with an image and some text, this is all working beautifully apart from the difference in the Brush I have to draw the background and the text with...
2
7060
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
4298
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...
0
1899
by: Andrew Baker | last post by:
Have a look at the code below. It's a really simple example where I have added two controls to a form, a textbox and a combo box. Both add owner drawn context menus to the controls, but the...
0
1723
by: Kenneth P. Graci | last post by:
Hi, vb.net - windows forms I need to know when the dropdown list on my derived combobox closes. There is a DropDown event and a OnDropDown override, but I want to know when it closes. It...
1
8132
by: Lars Netzel | last post by:
Hi! In VB.NET want to draw my own items in a ComboBox I have added a ComboBox to the Form with this. -----------------------------------------------------------------------------------...
2
12495
by: AMDRIT | last post by:
Hello Everyone, I would like to format the Display Members of a combobox's datasource. Is there a way to apply a format without subclassing the original datasource? For example, given a list of...
4
5531
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
5590
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...
5
18623
by: Kevinp | last post by:
I've spent the last four hours Google searching for a way to disable items in a Combobox. I found one example in C++ which I can't get to work and another in C# that I couldn't get to work either....
0
7213
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
7098
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...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.