Reputation: 8003
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).
Upvotes: 1
Views: 2234
Reputation: 125227
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.)
Upvotes: 5