Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change forecolor of disabled combobox

I need black forecolor in a disabled combobox. Is it possible?

like image 866
Sreedhar Avatar asked Apr 21 '09 06:04

Sreedhar


2 Answers

I have searched around for information in the past about this, and as far as I can tell, the best solution is to change the DrawMode of the combo box to OwnerDrawFixed or OwnerDrawVariable and then write your own drawing code in the DrawItem event of the combo box.

I found this article that goes into much more detail about it. Hope it helps.

like image 188
ryanulit Avatar answered Nov 20 '22 12:11

ryanulit


A "hack" I've used in the past for textboxes is to leave the control enabled, but capture the "OnFocus" event and immediately set the focus to some other object on the form, preferably a label since it doesn't show as being selected. I think this should work for comboboxes, too.

like image 4
Andy Stampor Avatar answered Nov 20 '22 12:11

Andy Stampor