473,473 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

enable / disable text boxes 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 ???
Nov 16 '05 #1
6 21798
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]
- mv*@spam.guard.caspershouse.com

"Lloyd" <an*******@discussions.microsoft.com> wrote in message
news:B6**********************************@microsof t.com...
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 ???

Nov 16 '05 #2
n!
> 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!
Nov 16 '05 #3
Using what sysntax will make this work??

textbox.Enable = false

apparently there is no definition for this
Nov 16 '05 #4
n!
> 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!
Nov 16 '05 #5
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
Nov 16 '05 #6
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 ?

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!
Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: HolaGoogle | last post by:
Hi all, Can you please tell me what's wrong with my code??? i do have this database in wich i have to field.One is a "yes/no" field and another one is "number" field. To display the yes/no field...
2
by: HolaGoogle | last post by:
Can you please tell me the right way to do this?? it's realy important! thanks in advance... Hi all, Can you please tell me what's wrong with my code??? i do have this database in wich i have...
1
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES...
4
by: chengsi | last post by:
Hi all, This is my first post, so please excuse if i am posting a silly question. I have an MS Access database and have created a tabulated form (where there are multiple lines, one for each...
4
by: Tom | last post by:
Hi: When you disable a text box you get the "ghost effect" on the associated label control. How can you mimic that same effect on a label not associated with a text box? Basically, the setup...
1
by: scanreg | last post by:
My form needs to (1) direct to specified URLs based on a combination of form selections and (2) enable/disable form features based on selections within the form FORM Radio 1 - A - B - C ...
1
by: javasachin | last post by:
Hello, I want to enable Struts2 Submit button <s:submit> in the client side using JavaScript based on the user inputs in some other controls (textboxes). If user is not entering any values in the...
10
by: viki1967 | last post by:
Disable/enable icon.gif Hi all. I have this form in the page.htm: <form action="form.asp" method="post" onsubmit="return(validateForm(this));"> <select size="1" name="t_im"...
1
by: rash007 | last post by:
I am building up a table in php built from an array in a database. I can assign each row its own id's etc. But I need to enable or disable checkbox buttons and a text area depending on the checkbox...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.