C # Windows program life and death

zhaozj2021-02-16  59

In the Windows program in the C #, although it can be quickly developed, but I don't know if the program is always not very cool, so I

Tracking the Windows program. Greatly understand the rules of the program running in the C # (because of the limited level of unmine)

):

First: Enter static void main ()

The second portion runs Application.Run in Static Void Main (New Form1 ()); the form is constructed in this intermediate.

2. Execute PrivatSystem.comPonentModel.Container Components = NULL; the role is that the Container class is the default implementation of the IContainer interface. The container is an object that packages and tracks zero or more components. In this context, the inclusion means a logical package instead of intuitive inclusion. Components and containers can be used in a variety of options, including visualization schemes and non-visualization. In a first out list, track the components in the container in a first list, which also defines the order of components in the container. The added components are attached to the end of the list.

2.2 Execute the Form Constructor PUBLIC FORM1 () Initialization Form

2.2.1 Performing a constructor

InitializeComponen ();

In this function, Windows Controls (System.Windows.Forms.Control)

And form initialization

2.2.2 Execute ResMelayout (FALSE);

ResumeLayout: When adjusting multiple properties of the control, you will be canceled with multiple Layout events using SuspendLayout and ResumeLayout methods. For example, a SuspendLayout method is usually called, and then sets the Size, Location, Anchor or Dock properties of the control, and finally calls the ResumeLayout (BOOL) method to make the change take effect. The default is TRUE to restore normal layout logic, FALSE changes the layout.

The third is executed, the form is displayed, and the program is running, waiting for the event, and responding to the event.

The fourth closes the form. EXIT Application.run (may be equivalent to the message loop mechanism in Windows) function,

The program ends.

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

New Post(0)