Question-C # code to add form controls

 

1             Label SnLable = new Label
2             {
3                 Size = new Size(SnLength, SnLength),
4                 BackColor = Color.Red,
5                 Location = new Point(10, 10),
6                 BorderStyle = BorderStyle.FixedSingle
7             };
8 
9             this.Controls.Add(SnLable);

 

After writing Do not forget this.Controls.Add (SnLable);

Guess you like

Origin www.cnblogs.com/Luck1996/p/12127468.html