Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check existence of control?
Message
From
24/12/2006 20:45:19
 
 
To
24/12/2006 20:38:54
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01180075
Message ID:
01180081
Views:
22
Sorry, I guess I misunderstood your question the first time.

You can try spinnning through the Controls collection maybe?
foreach (Control o in this.Controls)
{
	if (o is MyControl)
	{
		// then it's been added already
	}
}
~~Bonnie



>Hi,
>Thank you for reply.
>Then, how could I know the control is already added to form or not?
>
>Thank you
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