Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Clearing a portion of a Form
Message
De
11/04/2009 13:57:55
 
 
À
10/04/2009 16:52:48
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Application:
Desktop
Divers
Thread ID:
01394032
Message ID:
01394348
Vues:
37
>Well I tried this
>
>for (int i = this.Controls.Count; i >= 0; i--)
>            {
>                if ((string)this.Controls[i].Tag == "removable")
>                {
>                    this.Controls.RemoveAt(i);
>                }
>            }
>
>and still no luck. The count is always equal to 1.

I bet that's not the exact code you tried, because you'd get a runtime error with that:

If this.Controls.Count is 5, you'll get an exception when you try to access this.Controls[5].

~~Bonnie
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