Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clearing a portion of a Form
Message
From
11/04/2009 13:57:55
 
 
To
10/04/2009 16:52:48
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Application:
Desktop
Miscellaneous
Thread ID:
01394032
Message ID:
01394348
Views:
36
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform