How Do I set enabled to false on all but one web control on a page

K

Karen Grube

Hi!

What I need to do is loop through all the web controls on a page where
the tabindex is > 6 and set enabled to false.

I've got about 60 controls on a page and would rather not have to set
each one individually. Any suggestions? Here's a snippet of code I found
and tried to modify but it doesn't work. I know this is wrong (incomplete) ,
but I'm not sure how to get to the value of the tabindex property, test it,
and then set the enabled property on that control.

Dim control As Control
Dim t As System.Type
For Each control In Page.Controls
t = control.GetType().GetProperty
If t = 1 Then
CType(control, TextBox).Enabled = False
End If
Next

Thanks!
Karen Grube
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top