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.