ExpressionEditorPanel change button hover color

Posted by: ydolapchiev on 15 December 2021, 9:04 am EST

    • Post Options:
    • Link

    Posted 15 December 2021, 9:04 am EST - Updated 4 October 2022, 8:36 am EST

    I have changed the ExpressionEditorPanel button colors to better fit the main theme of our program, but I cannot find a way to change the color that the buttons are highlighted in when the mouse hovers over them. How do I access this brush and change it?

    The blueish white color of the AND button is the one I want to change

  • Posted 16 December 2021, 2:15 am EST

    Hello,

    Thanks for the snapshot.

    You can change mouse hover brush for C1ExpressionEditorPanel’s buttons.

    JFYI, C1ExpressionEditorPanel’s button has C1BrushBuilder for mouse hover brush. To change the hover color you can handle Loaded event of C1ExpressionEditorPanel as : (see code snippet)

    
    private void Panel_Loaded(object sender, RoutedEventArgs e)
            {
                var panel = sender as C1ExpressionEditorPanel;
                var stack = panel.Template.FindName("6_T",panel) as StackPanel;
                var hoverBrush = Brushes.Red;
                foreach(Button btn in stack.Children)
                {                
                    var mouseOverBrush = btn.Template.FindName("MouseOverBrush",btn) as C1BrushBuilder;
                    mouseOverBrush.DesignBrush = hoverBrush;
                    mouseOverBrush.DesignColor = hoverBrush.Color;
                    mouseOverBrush.Input = hoverBrush;
                }
            }
    
    

    Please refer the attached sample for the same : ExpressionEditorButtonStyling.zip

    Best Regards,

    Nitin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels