473,325 Members | 2,816 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,325 software developers and data experts.

BackColor in ComboBox items

hi!!!

is it possible to set the backcolor to red of the items in a combobox
and make the combo itself be white as it is default ?

when i set combobox.backcolor i set both combox backcolor and combobox
items backcolor.

-Geir

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
1 5324
Hi Geir,

I haven't tested it, but you may be able to do it by setting OwnerDraw and
DropDown (not list).
If you have DropDownList you will get an event to paint the item in the
TextBox. This would be the selected item, so if your selected item has a
white background you will be ok.

Happy Coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #2

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

Similar topics

3
by: Wayne Wengert | last post by:
I am trying to populate a combobox with a lisy of items. I want the 1st item to be "Make a Selection" and the following items will be names from a table in my DB (See code below). When I run the...
1
by: Rachel Suddeth | last post by:
When I put a ComboBox on a form, I can enter strings through the designer to fill Items collections. I have put a ComboBox in a UserControl, and exposed the the Items collections with the same...
1
by: Firewalker | last post by:
I am attempting to change the backColor property on the previously instantiated buttons FROM a listbox_doubleClick event. I thought it would be something like this: If...
5
by: James P. | last post by:
Hello, For my new Windows application, all I want is to create an initial form to demo to the user to show them how it looks like with some data on it. So I figure the fastest way is to create...
6
by: Sakharam Phapale | last post by:
Hi All, How to fill one ComboBox from other ComboBox control? 1) Only setting the reference does the trick but doesn't show items in control. If you see in immediate window, it shows...
4
by: Lars E. Nes | last post by:
Hi all. I am setting some color on my combo's: this.combobox1.BackColor = Colors.White; This only works when the combobox is enabled. How can i add color to a disabled combobox? Lars
7
by: samoore33 | last post by:
I am trying to dynamically add items to a listbox or combobox. The items add to either, but when I look through those items, there is nothing there. If I choose an item, it shows up. Not sure...
2
by: polocar | last post by:
Hello, I'm developing a C# program using Visual Studio 2005 Professional Edition. In the main form I have inserted a ListView control that is populated in a different way depending on the item...
5
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I want to create a customized ComboBox where the methods ComboBox.Items.Add and ComboBox.Items.Insert will behave thusly: -- If the item is not present, add it. -- If the item is present, set the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.