简体   繁体   中英

How to increase font size of TabControl item?

In my winform project I need to increase the font size of the TabControl items, but if I increase the size, also the content of the TabControl changes the own size... any ideas?

I also want to change the background of the TabControl palette (not the entire tabControl) .

在此处输入图片说明

If you want to change the font and back color of tab pages without changing the font and back color of child controls, you should know:

The Font and BackColor properties are ambient properties.

An ambient property is a control property that, if not set, is retrieved from the parent control. For example, a Button will have the same BackColor as its parent Form by default. For more information about ambient properties, see the AmbientProperties class or the Control class overview.

You can set the Font and BackColor for each tab page explicitly. This way, the child controls of tab pages, use Font and BackColor of TabPage .

You can explicitly set control's ambient properties to prevent them from using parent's property value.

(Thanks to TaW for better option rather than using panel as container of controls in the tab page.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM