I have a TabControl consisting of several TabPages. One of these tables contains a TreeView, and the other contains a DataGridView. I would like these controls (and tabs) to be in AutoSize to the maximum size allowed in TabControl without scrolling.
The DataGridView contains an AutoSize property inherited from the control that extinguishes the control if it is enabled. TreeView does not have this property. I tried to set the size to TabControl.Size, but that does not take into account the borderize and the height of the Tabbar.
treeView.Size = new Size(tabControl.Size.Width - SystemInformation.Border3DSize.Width * 2, tabControl.Size.Height - SystemInformation.Border3DSize.Height * 2);
My question is: how can I determine the height of the Tab buttons or how can I automatically populate the TabPages to their maximum size with a single control?
source
share