How can I dynamically initialize a win form. In my application I am having numerous forms, like more than 50 and the below code is repeated as many times..
so I want to create some function for it and do this job. But how can I create a new () instance
of a particular Form.
Any help will be greatly appreciated.
private void ShowForm(object frm)
{
if (frm == null || frm.IsDisposed)
{
frm = new <<Here is some Class Name>> { MdiParent = this };
frm.Show();
frm.WindowState = FormWindowState.Maximized;
}
else
{
frm.Activate();
}
}