Get user controls from form.Controls???

G

Guest

Hi,

I have a situation where I need to iterate through a forms controls
collection and I need to do special processing on any control that is a user
control. At run-time I won't know the names of the user controls.

Is there an easy way to tell if a control is a user control while iterating
through a controls collection?

Cheers!
 
R

Robert Jordan

I have a situation where I need to iterate through a forms controls
collection and I need to do special processing on any control that is a user
control. At run-time I won't know the names of the user controls.

Is there an easy way to tell if a control is a user control while iterating
through a controls collection?

if (ctl is UserControl) {
...
}

bye
Rob
 

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

Top