Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control Enumeration
Message
From
18/11/2004 13:41:39
 
General information
Forum:
ASP.NET
Category:
Web forms
Miscellaneous
Thread ID:
00962523
Message ID:
00962740
Views:
12
Try something along the lines of this pseudo-code, using recursion:
this.CallRecursive(this.Controls);

public void CallRecursive(ControlCollection oControl)
{
	for (int i = 0; i < oControl.Count; i++)
	{
		object o = oControl[i];
		if (o is "any of the container controls")
		{
			Control c = (Control)o;
			this.CallRecursive(c.Controls);
		}
		else
			// do whatever you needed to do
	}
}
~~Bonnie

>Hello,
>
>Any ideas on iterating thru ALL the controls inside a winform (including controls inside the tab control and other container controls)?
>
>thanks in advance...
>
>Paolo Benjamin T. Briones
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform