How to increase tab page width in tabcontrol width

I have a TabControl with two tabs.

enter image description here

How to make tabs fit into the width of the TabControl, as shown in the screenshot below.

enter image description here

I tried with the following line of code, but it does not work either.

tabControl1.SizeMode = TabSizeMode.FillToRight; 
+4
source share
3 answers

First set the tabControl1 size mode:

 tabControl1.SizeMode = TabSizeMode.Fixed; 

Then you need to recalculate the width of the bookmark title:

 tabControl1.ItemSize = new Size(tabControl1.Width / tabControl1.TabCount, 0); 

Please note: 1. A value of 0 means that the height will be the default. 2. Recalculate the size of the item after adding a bookmark to the tab. Think about what happens when you resize the control.

+5
source

This is an illegal way to solve this problem.

Increase indentation (X, Y) X 100 // represent some allowed numbers Y 3 // represent some allowed digit.

0
source

Source: https://habr.com/ru/post/1445017/


All Articles