Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control Enumeration
Message
De
18/11/2004 13:41:39
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Divers
Thread ID:
00962523
Message ID:
00962740
Vues:
11
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform