我希望通过编程调整我的winform上的选项卡控件的大小。
tabCtrl.Size.Width = Convert.ToInt32(numericUpDown1.Value);
tabCtrl.Size.Height= Convert.ToInt32(numericUpDown2.Value);
但我错了:
不能修改'System.Windows.Forms.Control.Size‘的返回值,因为它不是变量
是否知道如何以编程方式调整Tab控件的大小?
发布于 2012-09-04 11:40:06
使用这个。注意(int)
强制转换,因为NummericUpdown.Value
是一个decimal
值。
tabCtrl.Size = new Size((int)numericUpDown1.Value, (int)numericUpDown2.Value);
https://stackoverflow.com/questions/12270213
复制