如何以编程方式调整Tab控件的大小?

Mic*_*ael 1 .net c# tabcontrol winforms

我想在我的winform上以编程方式调整大小选项卡Control.

tabCtrl.Size.Width = Convert.ToInt32(numericUpDown1.Value);
tabCtrl.Size.Height= Convert.ToInt32(numericUpDown2.Value);
Run Code Online (Sandbox Code Playgroud)

但我得到错误:

无法修改'System.Windows.Forms.Control.Size'的返回值,因为它不是变量

知道如何以编程方式调整Tab控件的大小?

byt*_*e77 5

用这个.注意(int)演员因为NummericUpdown.Value是一个decimal值.

tabCtrl.Size = new Size((int)numericUpDown1.Value, (int)numericUpDown2.Value);
Run Code Online (Sandbox Code Playgroud)