Disable ForeColor

A

Andre

Hi,

Do we have a way to change the text color of a (textbox,
dropdownlist...) when they are at Enable = false.
Because i don't want to have light grey text when they are disabled.

I can use readonly on the textbox, but not with my dropdownlist.

Thank you !
 
A

Alvin Bruney [MVP]

Nope, is the short answer. It's disabled. You aren't allowed to muck with
it.
 
S

Scott

It's not possible in IE. For Mozilla and friends you can use:

input[disabled] {
color: #555555;
}

If you *have* to have this kind of thing in IE; then one solution is to create a custom TextBox
class that overrides the render method and generates something that looks like an <input> when the
control is !enabled, but isn't (for example, you could render <span style="border:solid 2px
black;color:#555555">Input Field Text</spa> -- you'd have to tweak the style to get it to your
liking).

Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top