TextBox Disabled

  • Thread starter Thread starter Claudio
  • Start date Start date
C

Claudio

I have a TextBox that sometimes I have to set its ENABLED property to false.
When I do this, I can not reas its text. Is there a way to change the
disabled backcolor and forecolor of the textbox, combobox and listbox?
 
Hi Claudio,

Instead of disabling the TextBox, you can set its ReadOnly = true;

Happy coding!
Morten
 
Hi Claudio,

A disabled TextBox is just that - disabled. You aren't going to be able to
read from it. If its at all possible, I'd recommend that you allow the
control to receive focus. One of the benefits is that you can cut and copy
text from the control.

If this is not the behavior you want, maybe you should use a Label control.

Toby Jones
Software Engineer
Human Head Studios
 
Ok. I can set the TextBox to readonly, but I have another control to
disable. It is a ComboBox? There is no readonly property. Any sugestion?
 
Claudio said:
Ok. I can set the TextBox to readonly, but I have another control to
disable. It is a ComboBox? There is no readonly property. Any sugestion?

You don't need to set read-only on a combo box -- just set its
'DropDownStyle' property to 'DropDownList'.
 
Back
Top