How to make Tab pages' widths fit into the TabControl's width

久未见 提交于 2019-12-04 06:59:18

First, set your tabControl1 size mode:

tabControl1.SizeMode = TabSizeMode.Fixed;

Then you have to recalculate width of the tab page header:

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

Pay attention: 1. value 0 means that height will be default. 2. Recalculate item size after you had added tab page to tab control. Consider what happens when you resize the control.

this is illegal way to solve this kind of issue

Increase the padding (X,Y) X 100 // represent some allowed figures Y 3 // represent some allowed figure.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!