I have a bunch of Forms that I embed in tabpages(some are embedded two and three layers deep) that I now suspect are giving me trouble. I have been told that User Control's are the better approach.
Now I am wondering how I canaccomplish this as quick as possible.
Is it as simple as copy and paste?
- Has anyone ever done something like this?
I have about 40 forms that I embedd that would need to be moved and not a lot of time to do it so any help is greatly appreciated.
EDIT 1
This is how I embed forms:
public static void ShowFormInContainerControl(Control ctl, Form frm)
{
frm.TopLevel = false;
frm.FormBorderStyle = FormBorderStyle.None;
frm.Dock = DockStyle.Fill;
frm.Visible = true;
ctl.Controls.Add(frm);
}
public static void DockControl(this Control control, UserControl userControl)
{
userControl.Dock = DockStyle.Fill;
control.Controls.Clear();
control.Controls.Add(userControl);
}