I have 2 Forms and i want them to be inserted into a form with a tabcontrol. I have read this question about adding forms to tabcontrols and Form1 is successfully inserted into the tabcontrol. Form2 is also inserted but the content of the form is not showing.
This is my code:
private FrmMainForm trackIT = new FrmMainForm();
private MainForm customer = new MainForm();
private void TrackITForm_Load(object sender, EventArgs e)
{
AddNewForm(trackIT, trackitTab);
AddNewForm(customer, customerTab);
}
public void AddNewForm(Form form, TabPage tab)
{
form.WindowState = FormWindowState.Maximized;
form.TopLevel = false;
form.Parent = tab;
form.Visible = true;
}
I also have set my parent Form's IsMDIContainer property to true.
What can be the issue here?