[Solved] How disable the main form when I have a sub-from open [closed]


If you want to show the sub-form while the main form is visible but in disable mode, just follow the code below:

subForm.ShowDialog(); //Shows both main and sub form , but the main form is not accessible .

But if you want to have your main form hidden, follow this example :

this.Hide(); //Hides the main form.
subForm.ShowDialog(); //Shows the sub form.
this.Show(); //Shows the main form again after closing the sub form.

solved How disable the main form when I have a sub-from open [closed]