473,569 Members | 2,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ComboBox DrawItem

hi-

when

private void theCombo_DrawIt em(object sender,
System.Windows. Forms.DrawItemE ventArgs 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 7018
Could you use something like:

private void theCombo_DrawIt em(object sender,
System.Windows. Forms.DrawItemE ventArgs e){
ComboBox cb = (ComboBox)sende r;
object o = cb.Items[0];
/*... do stuff here with o ...*/
}

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

when

private void theCombo_DrawIt em(object sender,
System.Windows. Forms.DrawItemE ventArgs 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_DrawIt em(object sender,
System.Windows .Forms.DrawItem EventArgs e){
ComboBox cb = (ComboBox)sende r;
object o = cb.Items[0];
/*... do stuff here with o ...*/
}

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

fragget <fr*****@home.c om> wrote in message

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

when

private void theCombo_DrawIt em(object sender,
System.Windows. Forms.DrawItemE ventArgs 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
9090
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 if the item is the currently selected one. I have selected a blue (SystemColors.Highlight) background brush and white (SystemColors.HighlightText)...
2
7065
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 when I compile the project the interface did not change. How can I override the OnPaint of this component. Thanks in advance.
5
4304
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 really don't want to have to make a UserControl that has both a label and ComboBox in it. I would rather have my control derive from a ComboBox for...
0
1905
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 combobox will NOT draw custom drawn context menu item. I have tried EVERYTHING (deriving from MenuItem and even tried calling TrackPopupMenuEx directly),...
0
1729
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 is an ownerdrawn combobox, so i am handling the Drawitem event myself.
1
8142
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. ----------------------------------------------------------------------------------- 'ComboBox1 '
2
12499
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 decimal values, format them as currency values with a leading currency symbol and 2 decimal places. TIA Class Test
4
5536
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 items. Any ideas or sugesstions would be appreciated. Thank you,
6
5600
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 Vista when this mode is set, the control is all one color indicating that you can't type in it and looks really slick. How do i reproduce this behavior?
5
18675
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. Does anyone have some good code for an owner-drawn combobox?
0
7698
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8122
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
937
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.