I have a custom class file in C# that I inherited and partially extended. I am trying to re factor it now as I have just enough knowhow to know that with something
You don't need generic to do this:
public static void ShowFormInControl(Control ctl, Form frm) {
frm.TopLevel = false;
frm.FormBorderStyle = FormBorderStyle.None; // Others rarely make sense
frm.Dock = DockStyle.Fill;
frm.Visible = true;
ctl.Controls.Add(frm);
}
Sample usage:
public Form1() {
InitializeComponent();
ShowFormInControl(this.panel1, new Form2());
}