Three ways to open other forms
Show-for example, login interface to the main page, directly display the main page, two forms do not affect each other
Public Partial class Form1:form { public Form1 () { InitializeComponent (); } Private void button1_click (object sender, EventArgs e) { new Form2 (); F2. Show (); } }
Show open new Form
Owner-for example, the "Replace" option in the text file, which does not close after opening the interface is also allowed to manipulate the main page (Li Yu lxc)
Public Partial class Form1:form { public Form1 () { InitializeComponent (); } Private void button1_click (object sender, EventArgs e) { new Form2 (); This ; F2. Show (); } }
Owner opens a new form
ShowDialog-such as the "open" option in the text file, opening the interface without closing is not allowed operation of the main page (Lee brainstorming Lxc)
View Code
c#-winform-three ways to open other forms-show (), set owner (), ShowDialog ()