Controls Collection

  • Thread starter Thread starter et
  • Start date Start date
E

et

you used to be able to do:
dim ctrl as Controls
for each ctrl in myform
'do this
next

Now I cannot do that. How can I do something for every control on a form or
a page.
 
Subject: Controls Collection
From: "et" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet

you used to be able to do:
dim ctrl as Controls
for each ctrl in myform
'do this
next

Now I cannot do that. How can I do something for every control on a form or
a page.

Considering you haven't initialized myForm, no you cant.

Have you tried iterating over:

For Each ctrl in yourPage.Controls

In C# the current page is called this, as in this.Controls

Can't help you right now in VB. (Bad memory!)

-- ipgrunt
 

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

Back
Top