读书人

求解代码生成的button怎么设定大小

发布时间: 2012-04-05 12:42:40 作者: rapoo

求解,代码生成的button如何设定大小啊
比如说

Button b1 = new Button();
b1.Height = 10;
b1.Width = 10;
b1.Location = new Point(25, 25);
this.Controls.Add(b1);
这样为啥不行呢?
说空间的Height不是变量,不能改变,我应该怎么做啊?

[解决办法]
后面加一句
b1.Size = new System.Drawing.Size(100, 50);

读书人网 >C#

热点推荐