我想改变选项卡控件的字体,因为我希望选项卡页标题中的文本看起来更大。但是,当我在设计器中更改选项卡控件的字体属性时(我使用的是MS VStudio 2010),它的子控件的字体也会改变(如标签和树形视图),这不是我想要的。我只想改变选项卡页标题的字体。
编辑: 我考虑通过循环遍历子控件,以代码方式更改选项卡控件的子控件的字体属性(如果有的话)。这个想法会有什么问题吗?
编辑: 我考虑通过循环遍历子控件,以代码方式更改选项卡控件的子控件的字体属性(如果有的话)。这个想法会有什么问题吗?
Font
属性的定义如下所述。 The Font property is an ambient property. 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
如果您想在父级别指定某些字体,但不希望其被子元素继承,则需要手动为子控件分配其他字体。