hi, i am having problem with closing user control.
i have some function in my parent form(with panel2):
public void ActivateUserControlOne()
{
panel2.Controls.Clear();
UserControlOne = new UserControlOne();
panel2.Controls.Add(this.UserControlOne);
}
...and UserControlOne appears.
i want to close(remove) UserControlOne on Cancel()(Cancel is function in UserControlOne) and load another User Control (UserControl2) to panel2:
public void Cancel()
{
this.Parent.Controls.Remove(this);
}
any ideas how to do that?!