Make controls inherit font from parent form or container

6 posts, 1 answers
  1. Alex
    Alex avatar
    7 posts
    Member since:
    Feb 2013

    Posted 18 Jul 2013 Link to this post

    Hi,
    In traditional WinForms all controls on a form inherit their Font property from it's parent form or container by default.
    Apparently, this is not the case with Telerik WinForms. 

    When there are many controls on a form, it becomes very uncomfortable. Especially when dealing with DropDownList controls.
    Not only you have to set control's Font property to the font you desire (which only sets the font of the selected text),
    you also have to handle the VisualListItemFormatting event and set args.VisualItem.Font programmatically to set the font of drop down items.

    Am i missing something simple or is it just the way it is with Telerik?

    Thanks ahead,
    Uri
  2. Answer
    Paul
    Admin
    Paul avatar
    60 posts

    Posted 19 Jul 2013 Link to this post

    Hi Uri,

    Thank you for writing.

    You are correct in your observation. Our controls behave in a different way when it comes to styling. They consist many elements, and every element can be styled separately, this allows for greater flexibility when it comes to design. Once the design is created we do not want to override the settings for the child elements.
    Because of this I would recommend you to use our visual style builder to style your applications the way you want them to look like.

    More information about the Telerik Presentation Framework can be found here: http://www.telerik.com/help/winforms/tpf-overview.html. Also, this is a nice article about the property precedence in TPF: http://www.telerik.com/help/winforms/tools-visual-style-builder-working-with-visual-style-builder-property-precedence-rules.html.

    Hope that helps. Please do not hesitate to contact us, should you have further questions.

    Regards,
    Paul
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Alex
    Alex avatar
    7 posts
    Member since:
    Feb 2013

    Posted 19 Jul 2013 Link to this post

    Thank you Paul,
    But i think you should consider making controls automatically inherit the Font (and maybe some other properties) from it's parent when its dropped onto a form in future releases. Its rarely ever useful to have different fonts on a single page (unless its a font editing page) or even in the same application.

    By now i'll just set everything manually,
    But thanks anyway
  5. Paul
    Admin
    Paul avatar
    60 posts

    Posted 24 Jul 2013 Link to this post

    Hello Uri,

    Thank you for writing back.

    You have a point here. We will consider the best way to combine both flexibility and usability.
    Thanks again for the useful feedback.

    Please let us know if we can be of further assistance.

    Regards,
    Paul
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Mike
    Mike avatar
    3 posts
    Member since:
    Jul 2011

    Posted 21 Jul 2015 Link to this post

    has there been any development on this, perhaps a theme/control setting that would allow us to set inheritance?
  7. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 24 Jul 2015 Link to this post

    Hello Mike,

    Thank you for writing.

    Currently, there is no global setting to provide the behavior discussed in this thread.

    Telerik controls are built on top of Telerik Presentation Framework incorporating complex hierarchies of RadElements organized in logical trees. No matter how complex a control may be, it can be fully customized by manipulating the elements which are building it. Additional information about TPF you can find in the following section of our documentation: Telerik Presentation Framework

    The RootElement of a control inherits the Font property as well as many others, related to its visual appearance from the parent control. However, in order to allow customizations many of these settings are defined through themes. This breaks the inheritance with any of the parent RadElements and eventually the control's parent. Please note that some properties are inherited from their parents and some are not because they are defined through themes.

    I hope this information is useful. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready