I have a form which contains a bunch of controls. When I change the form font, the font change event propagates to the children. That is the desired behavior except for the datetimepicker control, where I do not want the font change to trigger. Is it possible to prevent it, or do I have to set the font back to the original after the change is complete?
+2
A:
I assume you're using WinForms - where property inheritance is the normal behavior. The only reliable way to control the font on a particular child is to set it explicitly, as you indicate.
In newer UI frameworks, like WPF, you can use styles and templates to control the appearance of controls. But this is not available in WinForms.
LBushkin
2010-10-08 14:01:32
+1
A:
If you explicitly set the font on your DateTimePicker, it will not change when the form font changes. (assuming WinForms)
Stuart Dunkeld
2010-10-08 14:03:58
That is correct, but for some reason it still resizes it.
Serge
2010-10-08 17:39:20