enable / disable text boxes programmically

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

Guest

How do you make a textbox enabled or disabled ???

i have tried Textbox.disable or enable but the controls apparently dont have this property programmically ???
 
Lloyd,

You can set the Enabled property of the TextBox control to true in order
to do this. I am assuming you are using a Windows Forms textbox.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Lloyd said:
How do you make a textbox enabled or disabled ????

i have tried Textbox.disable or enable but the controls apparently dont
have this property programmically ???
 
How do you make a textbox enabled or disabled ????
i have tried Textbox.disable or enable but the controls apparently dont
have this property programmically ???

They have an 'Enabled' property which you may set to true (for enabled) or
false (for disabled).

n!
 
Using what sysntax will make this work??

textbox.Enable = false

apparently there is no definition for this
 
Using what sysntax will make this work???
textbox.Enable = false;

apparently there is no definition for this

You forgot a 'd' :)

textbox.Enabled = false;

As Nicholas said, he (and I) are assuming you mean a
System.Windows.Forms.TextBox object. It's also described in the .NET
framework documentation (http://tinyurl.com/25tj6).

n!
 
Yes, its a windows form object but it fails to work... it says that System.Web.UI.....HtmlInputText does not contain a definition for Enabled

I know it sounds like im an idiot, but this is frustrating as hell to do something so simpl

L
 
Yes, its a windows form object but it fails to work... it says that
System.Web.UI.....HtmlInputText does not contain a definition for Enabled ?

Ahh, that's not a windows forms textbox though (it isn't even a windows
forms control :). I don't know anything about web controls, sorry.

n!
 
Back
Top