Run a C # program

The first part: entering static void Main ()  

Second portion: Run static void Main Application.Run (new Form1 ( )) () in; constructed to form in the middle. 
      2.1 performing private System.ComponentModel.Container components = null; Container class default action is IContainer Interface. Package and container tracking is zero or more components of an object. In this context, it refers to a logical containment bag wing, rather than inclusive intuitive. Components and containers can be used in a variety of schemes, including visual and non-visual programs scheme. In a first in first out list of the tracking assembly container, the list also defines the order of the components within the container. The added component will be appended to the end of the list. 

      Constructor execution 2.2 Forms public Form1 () to initialize the form 
          2.2.1 constructor is executed in the InitializeComponent (); for WINDOWS control (the System.Windows.Forms.Control) and in this form initialization function 
          2.2.2 performed ResumeLayout (false); ResumeLayout: when adjusting the controls of multiple attributes, will have to use methods ResumeLayout SuspendLayout and cancel multiple Layout events. For example, the first call is usually SuspendLayout method, and then set the control's Size, Location, Anchor or Dock property, the last call ResumeLayout (bool) method for the changes to take effect. The default is TRUE Resumes usual layout logic, FALSE change the layout. 

After the third display form is executed, were running the program, wait for events and respond to events. 

Fourth closed form. Exit Application.Run (cycle mechanism may be equivalent to the WINDOWS message) function, the program ends.

Reproduced in: https: //www.cnblogs.com/zhangchenliang/archive/2012/04/10/2439989.html

Guess you like

Origin blog.csdn.net/weixin_33985679/article/details/93495059