tags:

views:

84

answers:

4

I have a text box that when it is disabled the text in it is gray and kind of dithered. (This is the standard functionality.)

Is there a way to make this easier to see?

I have tried this:

txtBoxNumber.Enabled = false;
txtBoxNumber.ForeColor = Color.Black;

and that has no effect.

NOTE: This is a .net Compact Framework app, but I am not tagging the question with CF because I think it is the same for normal .net.

+9  A: 
txtBoxNumber.ReadOnly = true;
// Then set your styles here...

HTH.

Sunny
+5  A: 

Why don't you make the TextBox.ReadOnly instead? That would allow the user to see & copy the textbox value, but not change it. A read-only textbox is usually rendered the same way as a normal textbox.

From MSDN:

You can use this feature instead of disabling the control with the Enabled property to allow the contents to be copied and ToolTips to be shown.

dtb
A: 

I often set it to read only or if you have to use disabled set the text box color to white and the font color to black.

Justin
A: 

Just make the text box Read-Only. And then if you need to set style, set it.

Johnny