am using below code to add a Form to a tabControls tabPage
private void btnStudents_Click(object sender, EventArgs e)
{
foreach (Form c in tabStudents.TabPages[0].Controls)
{
tabStudents.TabPages[0].Controls.Remove(c);
c.Dispose();
}
//load form
StudentsMasterForm f = new StudentsMasterForm
{
TopLevel = false,
FormBorderStyle = FormBorderStyle.None,
Dock = DockStyle.Fill
};
tabStudents.TabPages[0].Controls.Add(f);
f.Show();
}
the problem however is, there is too much form flickering when the button is clicked (i.e when the form is loaded). I have tried using tabCustomersAndOrders.TabPages[0].SuspendLayout();
and tabCustomersAndOrders.TabPages[0].ResumeLayout();
` but the flickering isn't going away.
I want to transition from one form to another to be as smooth as possible.