prevent child to inherit graphic properties

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

If I have a GroupBox and let's say a button inside. When I change the
GroupBox's font to bold, the button font is also set to bold.

How can I prevent this? Without having to redefine the font for the button
as well.

And why is there no such behavior with CF?

Thanks,
Sitar.
 
The default behavior, by design, is to inherent the parents settings. If you
want different behavior you need to override that and implement whatever you
want.
 
What you're seeing is ambience. You can see this behavior with certain
desktop framework control properties such as BackColor, ForeColor, Font. See
the remarks at the link below for more on this.
http://msdn.microsoft.com/library/d...rfsystemwindowsformscontrolclassfonttopic.asp

AFAIK, the only way to turn off this behavior is to derive from the control
and handle the property yourself.
And why is there no such behavior with CF?
Because the dev team didn't design it that way.
 
Back
Top