Form1 frm = new Form1();
frm.mdiParent=this;
frm.show();
I want to create a global method showFrm(Form formToShow) which i can access from anywhere in my project.
I’ve tried.
public void showFrm(Form formToShow)
{
formToShow f=new formToShow();//getting error here
f.mdiParent= mdiForm;
f.show();
}
Put this method in your “only parent form” class:
Usage:
I would also remind you that C# is case-sensitive.