简体   繁体   English

如何增加TabControl项目的字体大小?

[英]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? 在我的WinForm项目,我需要增加的字体大小TabControl项目,但如果我增加了尺寸,还的内容TabControl改变自己的大小...任何想法?

I also want to change the background of the TabControl palette (not the entire tabControl) . 我还想更改TabControl面板的背景(而不是整个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. FontBackColor属性是环境属性。

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. 例如,默认情况下,一个Button与其父Form具有相同的BackColor For more information about ambient properties, see the AmbientProperties class or the Control class overview. 有关环境属性的更多信息,请参见AmbientProperties类或Control类概述。

You can set the Font and BackColor for each tab page explicitly. 您可以为每个选项卡页面显式设置FontBackColor This way, the child controls of tab pages, use Font and BackColor of TabPage . 这样,选项卡页的子控件使用TabPage FontBackColor

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.) (感谢TaW提供更好的选择,而不是使用面板作为选项卡页面中的控件容器。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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