RadComboBoxItem - Change Foreground on Mouseover

2 posts, 0 answers
  1. Paul Exler
    Paul Exler avatar
    11 posts
    Member since:
    Aug 2012

    Posted 19 Jun 2012 Link to this post

    How to change the Foregroundcolor of the ContentPresenter for a state like MouseOver?

    When i create a copy of the RadComboBoxItem Template, i have access to the States of the ItemTemplate.
    But as long the ContentPresenter grabs his ForegroundColor from the Style (and not from its Template) i cannot set my own Foreground for a state.

    How to solve that?

    It's an WPF Project and i am using Blend 4, with RadControls for WPF Q3 2011 SP1

    Thanks for any idea.
  2. Dani
    Dani avatar
    848 posts

    Posted 19 Jun 2012 Link to this post

    Hi Paul,

    The MouseOver animations are contained in the VisualStates just as you pointed out. So, in order to change Foreground on mouse over, you will need to modify the Style (to be more specific, the brush that the mouse over state uses) and not the ContentTemplate.

    Since you cannot set the Foreground property in a ContentPresenter, what you can do is to generate the ItemContainerStyle for the RadComboBox and then change the ContentPresenter to a ContentControl. Then, you are free to specify a custom Foreground brush for that ContentControl in the MouseOver state.

    I hope this helps.

    Kind regards,
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top