C# ALLOW ONLY 1 INSTANCE OF A FORM TO BE OPENED - Printable Version +- Agario Forum | The Online Agar.io Leading Community (http://agarioforums.net) +-- Forum: Secret (http://agarioforums.net/forumdisplay.php?fid=20) +--- Forum: TechTalk (http://agarioforums.net/forumdisplay.php?fid=29) +--- Thread: C# ALLOW ONLY 1 INSTANCE OF A FORM TO BE OPENED (/showthread.php?tid=46655) |
C# ALLOW ONLY 1 INSTANCE OF A FORM TO BE OPENED - Owl - 12-22-2017 In this example I will show you how to only allow one instance of a form to be open when using MDI parent forms. An MDI parent form acts as a container in which you are able to open other forms inside of. If you have a multiform application this can help with screen clutter since it will be self contained. To make a form an MDI parent head over to the form properties and set IsMdiContainer to true. Any form that you wish to open in this form, you would set their mdiParent to this form. However the code below will handle this for you. Code: Using the method Code: private void loginRegisterToolStripMenuItem_Click(object sender, EventArgs e) |