Is there a way I can do some validation before loading a usercontrol? I have a usercontrol that I only want to load when certain conditions are met, any ideas?
Printable View
Is there a way I can do some validation before loading a usercontrol? I have a usercontrol that I only want to load when certain conditions are met, any ideas?
Code:if (some condition)
{
MyUserControl uc = new MyUserControl();
// Set properties of uc here, e.g. Location, Size, etc.
this.Controls.Add(uc);
}
Very cool, I didn't have this line:
this.Controls.Add(uc);
Thanks alot :)