Click here to Skip to main content
16,022,542 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a combo box in my code. it's dropdown style is set drop donw.

When selecting an item blue color appears in combo box.

Because of that selected value is not visible. So I want to change that blue to some color to white.tell me the answer.
Posted
Updated 26-Oct-11 21:34pm
v2

Hi,

Try these:

private void Form1_Load(object sender, EventArgs e)
{
    donw.BackColor = System.Drawing.Color.White;
    donw.ForeColor = System.Drawing.Color.DarkBlue;
    //.. some code here...
}


Remember to vote if could help...

Regards,
 
Share this answer
 
AFAIK, there is no facility to change the Selected Item color for a ComboBox - it uses the Windows default. It is possible to change that, but I wouldn't as it will probably annoy your users no end. If an application did that to my system, it would get uninstalled immediately, and I would be looking for my money back.

You could handle the Paint event for the ComboBox and draw the text / selection status yourself, but I've never tried so I can't say how much work is involved.

I would find another way round your problem, if I could - it isn't normally a problem, so why is it one in your app?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900