If you want to use winform to write something, you may encounter a depressing problem. If you want to transfer values between forms, you may encounter difficulties. Find a solution on the Internet and create one. Suppose you want to create form2 in form1 and form2 to access form1, the simplest way is to addPublic Form1 parent;
When form1 is created as follows:Form2 F2 = New Form2 ();
In form2, you can use parent to access form1.
However, if form1 and form2 have no parent-child relationship, form2 is not created in form1, and form2 is not created in form1. How can we get the instance of the other party? Form1 is used as an example. We create another form and use it to instantiate other forms, such as starter.
Add the static variables F1 and the static method getform1 () in starter ():Class starter
You can use starter. getform1 () to get F1. Set starter to minimize startup. If it is not displayed in the status bar, we will not see it.
PS: We also found that any event's xxxing () processing function can include eventargs e of the event. if cancel is set to true, the event is canceled. It is only now that this useful stuff is known... -_-