How to resize tabControl height to fit Windows Form Height on Windows 7 with scale factor set to 150%

  • Thread starter Thread starter E-John
  • Start date Start date
E

E-John

Guest
Dear All,

How to resize tabControl height to fit Windows Form Height on Windows 7 with scale factor set to 150%

I tried to use a Panel control to embedded the tabControl to let the system to adjust the height of tabControl, but NOT works.

Because after scale factor is set, the Width and Height of Windows Form is changed,

I get the height of Windows Form and set this value to the height of tabControl and all the tabPages inside tabControl, like

below, but still NOT works.

tabControl1.Height = this.Height;
foreach (Control t in this.tabControl1.Controls)
{
TabPage tabPage = (TabPage)t;
tabPage.Height = this.Height;
}
label1.Text = tabControl1.Height.ToString() + ", " + this.Height.ToString();

How to set the tabControl to fit the Windows Form correctly when scale factor is changed.

BTW, it runs OK under Windows 10 system.

1310636.png



Thanks and Best Regards,

E-John

Continue reading...
 
Back
Top