I am using combo box in WinForm but when i was selected any item in combo box then selected item background color is blue. i want to remove this blue background color (particularly on form load, tried to set focus to other control in the form, but combo highlight not removed) but item should be selected .
Can anybody help out on this...?
To solve the same I have tried almost EVERYTHING:
DropdownStyle
property to DropdownListthis.BeginInvoke(new Action(() => { comboBox1.Select(0, 0); }));
combobox1.SelectionLength = 0;
comboBox.TabIndex
SendKeys.Send("{ESC}");
because it is not a reliable solutionNothing helped. Maybe because I don't have text in my combobox items, only images. The only stable and working solution was to move a focus on another Label control:
label.Focus();
You could also hide that label.
It appears that the only way to do this is by subclassing the combobox control.
Here is an example where someone does that:
http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/e234c4a7-0cf7-4284-a072-8152f7593002/
There are probably more on the web to guide you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With