Questions about instantiation and running forms

xiaoxiao2021-03-06  31

There are three ways: one: [stathread] static void main () {form1 newform1 = new form1 (); newform1.showdialog ();

Two: [Stathread] static void main () {form1 newform1 = new form1 (); Application.run (newform1)} The three: [stathread] static void main () {Application.run (New new form1 ())}

=================================================

If you use the slog of this () method to run down, the rectification program is the most ended when the program runs to the last line, so your form is like the form is displayed, and if you use ShowDialog ( This method does not run down when the form is not turned off, that is, the program will not quit until you have turned the form program to exit. Or use Application.run () method, with this method It is equivalent to a loop program that will continue until your form is turned off down to exit.

转载请注明原文地址:https://www.9cbs.com/read-81968.html

New Post(0)