tags:

views:

49

answers:

2

Hi,

what are the background and foreground colors of a textbox when it's disabled in .net ?

+5  A: 

This depends on the styles that you've defined in Windows, unless you're specifiying the color that should be used explicitly (and choose one that is not dependent on Windows settings)

Frederik Gheysels
This is of course assuming that he is talking about textbox from windows UI and not from ASP.NET :-)
VinayC
I see that his question is decorated with a 'winforms' tag. :)
Frederik Gheysels
I see that Henk added the tag. Unless Henk is a mind-reader or a dear friend of the OP, we still don't know which UI Framework is being asked about.
Tergiver
A: 

From the System.Drawing.SystemColors class, use SystemColors.GrayText for the foreground color. From a quick test, I believe SystemColors.Control is the background color, although the documentation does not state this.

adrift