This is a migrated thread and some comments may be shown as answers.

Changing mouse-over color

5 Answers 1555 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Lennart Bauer
Top achievements
Rank 1
Lennart Bauer asked on 31 May 2010, 02:31 PM
Hi!

Is there a simple way to change the mouse-over color for a RadButton?
I have extracted the tamplate and there is a RenderMouseOver attribute. Can I change this in some way to achieve what I want?

Regards,
Lennart

5 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 03 Jun 2010, 09:24 AM
Hello Lennart ,

In order to change the mouse-over color of the RadButton control you have to make the following steps:
 - After  you edit  the style of RadButton you will see in its control template ButtonChrome control .
 - You have to edit the control template of the  ButtonChrome . In it you will find all the states of the RadButton control.

If you have further questions please do not hesitate to ask us.

I hope this will help you.

Regards,
Dimitrina
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Lennart Bauer
Top achievements
Rank 1
answered on 03 Jun 2010, 06:29 PM
Thanks! Can you supply a short example?
0
Dimitrina
Telerik team
answered on 07 Jun 2010, 01:25 PM
Hi Lennart ,

Please find attached an example with a custom style of the RadButton control.

If you have further questions please do not hesitate to ask us.
I hope this will help you.



Kind regards,
Dimitrina
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Andi
Top achievements
Rank 1
commented on 22 Jul 2021, 01:48 PM

Really need 500 lines of template code to "simply" change color of button on mouse over 😯
What is a shorter solution?
Stenly
Telerik team
commented on 23 Jul 2021, 12:24 PM

You could use the Theme Helper class, which enables you to directly modify the appearance of a specific basic control without the need to alter its control template. Please not that ThemeHelper class currently works out-of-the-box with the VisualStudio2019, Crystal, Fluent and Material themes.

To use it simply add the following namespace:

xmlns:helpers="clr-namespace:Telerik.Windows.Controls.Theming.Helpers;assembly=Telerik.Windows.Controls"

and this attached property to the wanted control:

<telerik:RadButton helpers:ThemeHelper.MouseOverBrush="Red"/>

Please note that by default all the controls we provide use the Office Black theme. To alter it either switch the theme to one of the 
mentioned earlier or you will need to edit the default control template. The following documentations explain in depth how to do it if you chose the latter option:

Modifying Default Styles | Telerik UI for WPF

Editing Control Templates | Telerik UI for WPF

You could also check the following SDK, which shows how to change the visual states for the Office Black and Office2016 themes.

xaml-sdk/Buttons/CustomizeVisualStates at master · telerik/xaml-sdk (github.com)

I am also attaching an example project for your convenience. It uses the Material theme and the ThemeHelper class approach.

0
hal broad
Top achievements
Rank 1
answered on 09 Nov 2010, 10:53 PM
When I use this template on a RadRadioButton, I no longer get the different background color after the button is selected. Can you provide the section of the template that sets the selected/checked background color?

Thanks.
0
Viktor Tsvetkov
Telerik team
answered on 15 Nov 2010, 09:27 AM
Hello hal broad,

Could you please provide a snapshot of the desired outcome of the selected/checked background, because I am not sure what you exactly want to achieve?

All the best,
Viktor Tsvetkov
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
Buttons
Asked by
Lennart Bauer
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Lennart Bauer
Top achievements
Rank 1
hal broad
Top achievements
Rank 1
Viktor Tsvetkov
Telerik team
Share this question
or