Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Disable the text boxes in a code

0 views
Skip to first unread message

David

unread,
Jan 14, 2003, 10:39:33 AM1/14/03
to
Hi everyone.

I have a form with a bunch of controls (text boxes, check
boxes, etc) and I want to disable all the text boxes on
the server side. I can innumerate trough the controls but
how do I find out what type of control and disable it?
Any response would be greatly appreciated.

David.

Marcelo

unread,
Jan 14, 2003, 12:57:20 PM1/14/03
to
Hi,

if you can iterate through the controls, you can (supposing you gave a name
of ctrl):

if (ctrl.GetType() == typeof(TextBox))
{
((TextBox)ctrl).Enabled = false;
}

hth,

Marcelo

"David" <dav...@deweb.net> wrote in message
news:5b3801c2bbe3$22b12440$cef82ecf@TK2MSFTNGXA08...

david

unread,
Jan 15, 2003, 11:21:21 AM1/15/03
to
Thank you very mutch.
Works great.

David

>.
>

0 new messages