I searched everywhere and it overheard me because it seems like I'm the only one who asked about this before. How do you calculate tab width in Windows Forms TabControl ?
TabControl
Each tab that opens or is created in my application will have a variable length, and the font size and font used on these tabs may also change at runtime.
I managed to solve this problem myself by looking at intellisense a bit more. The TabControl.GetTabRect() method returns the rectangle for the tab:
TabControl.GetTabRect()
Rectangle rect = this.tabControl1.GetTabRect(tabControl1.SelectedIndex); MessageBox.Show(rect.Width.ToString());
You can get it using the ItemSize TabControl Property.
ItemSize
If you want to have the same width for all tabs, use the following:
this.tabControl1.SizeMode = TabSizeMode.Fixed;
Source: https://habr.com/ru/post/1482895/More articles:Changing the color of a specific item in Treeview WPF - c #How to exclude test run using VS2012, TFS Build and NUnit - tfsValidating a valid date in zend framework - dateHow to install opencv with tbb support using mingw - windowsSearch for a set of unique pointers - c ++Filter by category for NUnit MSBuild tasks? - continuous-integrationFormatting dual Android - javaHow to open Safari URL from settings.bundle - xcodeWhat does "select" do when nfds is 0? - cTransferring active objects between services via AIDL - androidAll Articles