winform learning (4)

Add a form, showing and hiding

Directly through the toolbar by dragging a control interface to the UI

You may be directly added to the code: the identity of the form .Controls.Add (control identifier);

Button myBtn = new Button();

myBtn.Text = "button created";

this.Controls.Add(myBtn);

The benefits of added code: no garbage code generation, to improve the efficiency of program execution.

 

Show and hide form:

Identifier form the .Show ();

.Hide form identifier ();

Guess you like

Origin www.cnblogs.com/1016391912pm/p/11454662.html