Ribbon:Button OnMouseHover

Ribbon for WPF Forum

Posted 10 years ago by Paras Sanghani
Avatar
Product Version: Docking & MDI v4.5.486

Product Version: Ribbon & MDI v4.5.484

hi


I am Using version 4.5.0484

I want to change the ribbon:Button on hover colour which is by default Orange. I want to change to any other colour.

I cant find any property to change the colour of the Button on the mouse hover effect.
Kindly let us know if any such property is available or any other way to do the same.

Comments (3)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Paras,

We don't currently have separate properties for setting specific backgrounds for mouse over, etc. However if you do a style trigger, perhaps you can update the Background property to achieve this when on mouse over.


Actipro Software Support

Posted 10 years ago by Paras Sanghani
Avatar
Hello,


I tried out using the style triggers for the ribbon:Button but it isn't supporting. Can u please provide us with an example.

The following code we are trying for the style triggers in Application Resource:
<Application x:Class="WpfDemosByP.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
StartupUri="StackPanelDemo.xaml">
<Application.Resources>
<Style x:Key="ButtonColour" TargetType="ribbon:Button">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Blue" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="Aqua" />
</Trigger>
</Style.Triggers>
</Style>
</Application.Resources>
</Application>


Also in xaml where we used this style code is given below for the ribbon:Button,

<ribbon:Button Style="{DynamicResource ButtonColour}" Name="btnSave">Save</ribbon:Button>


We tried using this way but for the actipro controls we are not able to use the Style Triggers.

Can your team give us the example for the Same....


Thank You,

Paras
Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Paras,

Hmmm... we tried a simple sample and couldn't get it to work with Style triggers either. See below:
<Control Background="Green" Width="100" HorizontalAlignment="Right" >
    <Control.Template>
        <ControlTemplate>
            <Rectangle Fill="{TemplateBinding Background}" />
        </ControlTemplate>
    </Control.Template>
    <Control.Style>
        <Style TargetType="Control">
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="Red" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </Control.Style>
</Control>
This probably means that we'd need to specifically add Brush properties for the various states or you'd have to copy and modify our default templates.


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.