HowTo:Change disabled control font color?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When a textbox/text area/dropdownlist is disabled, the font is grayed out.

Can I change the default color of disabled control to black?

I tried to override Disable/Enable property of textbox and set 'ReadyOnly'
instead of diabling the control. It works for textbox only because dropdown
list doesn't have 'READYONLY' property.

Any suggestion? I am thinking change system font settings from inside the
application. Anybody had the luck doing this?

strout
 
Ignore my reply as I thought I was replying to a post in MFC newsgroup.
Sorry for the confusion.
 
Actually the thread is helpful.

As I said before. I did make the disabled textbox showing gray bkgd color
and black forground color. I subclassed textbox and override Enabled property
and set it to read only. It's the same with MFC.

My problem is with drop down list and with other controls. Dropdownlist
doesn't have read only property and when you override enabled property, it's
selectable. It's dumb to reset it to original value. User can see the flash
change.

Any other help?

strout
 
I created a read-only check box by overriding the OnClick() method and
calling the base method only if my read-only flag was "false". Perhaps
you could do the same thing for the combo box.

Does anyone know whether Microsoft added ReadOnly to the other controls
in V2.0? I wish they would, because Enabled = false means not only
unchangeable, but also unreadable.
 
Back
Top