Home > other >  How to do c # Winform neutron window does not close the main window cannot be closed??
How to do c # Winform neutron window does not close the main window cannot be closed??

Time:12-30

If child window is not closed, X cannot use the main window, the child window, click on the main form of closing the window can be closed,,,,

CodePudding user response:

The problem, should be a pattern with the pattern, never done c # project, but the truth is interlinked, you can consult, the hope can help you!


Any Form (derived from the base class Form class), can be in two ways, according to
//the pattern form
The From qform=new Form ();
Qform. The Show ();
//mode form
The Form qform=new Form ();
Qform. ShowDialog ();
One, the difference of control
Form. After the Show create new Form (the model) and return immediately, and not in the current activities to establish any relationship between forms and new Form, that is in keeping the new window closed (or minimize) under the condition of existing Form or in the case of retain existing Form closed (or minimize) a new window, can be,
Form. The ShowDialog create model Form, that is, only when establishing new after the window is closed, the original Form to regain control, if not to close the new window and will not be any operation on the original movable window mouth, to minimize the new window, reduction will be conducted with the original window, but the closing of the new window has no effect on the original window,
It is important to note that no matter what the situation, as long as the main form is closed, or the end of the main program, then the Application. The Run will be closed all forms, whether it's a model or a model,

CodePudding user response:

Window to the child window is set to mode

CodePudding user response:

I see, thank you,

CodePudding user response:

But as long as the mobile child window to close the child window when an error
  • Related