Step 1: Enter static void main ()
Part 2: run application. Run (New form1 () in static void main (); construct the form in the middle.
2.1 run private system. componentmodel. Container components = NULL. The Container class is the default implementation of the icontainer interface. A container is an object that encapsulates and tracks zero or more components. In this context, inclusion refers to logical inclusion, rather than intuitive inclusion. You can use components and containers in multiple scenarios, including visualization and non-visualization solutions. Track the components in the container in the first-in-first-out list. The list also defines the order of the components in the container. The added component is appended to the end of the list.
2.2 execute the form constructor public form1 () to initialize the form
2.2.1 execute initializecomponent () in the constructor. In this function, initialize Windows controls (system. Windows. Forms. Control) and forms.
2.2.2 execute resumelayout (false); resumelayout: when multiple attributes of the control are adjusted, multiple layout events are canceled using the suspendlayout and resumelayout Methods successively. For example, you can call the suspendlayout method first, set the size, location, anchor, or dock attribute of the control, and call the resumelayout (bool) method to make the change take effect. The default value is true to restore the normal layout logic, and false to change the layout.
After the third part is executed, a form is displayed to run the program, wait for the event to occur, and respond to the event.
The fourth part is to close the form. Exit application. Run (which may be equivalent to the Message Loop Mechanism in Windows) function, and the program ends.