WinForm窗体中窗口控件的生成

1:button控件的生成方式

Button button = new Button();
button.Size = new Size(80, 80);
button.Location = new Point(10, 10);
button.Text = "aa";
this.Controls.Add(button);

注意:生成的控件需要添加到窗口的控件当中去,其实现代码his.Controls.Add(button);

猜你喜欢

转载自www.cnblogs.com/clhxxlcj/p/10935664.html
今日推荐