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

Hover Color

1 Answer 733 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
Maher Khalil
Top achievements
Rank 1
Maher Khalil asked on 02 Jun 2014, 07:26 PM
Hi Telerik
is there a Property to change hover color for buttons (radButton , ToggleButton) in UI Element Editor
without using Visual Studio Builder

if not how to change hover color in Visual Studio Builder  in single button without changing all

thank you

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 05 Jun 2014, 08:33 AM
Hi Maher,

Thank you for writing.

There is no such built-in property for the hover fill, but you can subscribe to the MouseLeave and MouseEnter events of the button and set the color there (in the mouse leave the styles are reset):
void radButton1_MouseLeave(object sender, EventArgs e)
{
    radButton1.ButtonElement.ButtonFillElement.ResetValue(FillPrimitive.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local);
    radButton1.ButtonElement.ButtonFillElement.ResetValue(FillPrimitive.GradientStyleProperty, Telerik.WinControls.ValueResetFlags.Local);
}
 
void radButton1_MouseEnter(object sender, EventArgs e)
{
    radButton1.ButtonElement.ButtonFillElement.BackColor = Color.FromArgb(153, 204, 55);
    radButton1.ButtonElement.ButtonFillElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
}

If you change the color in Visual Style Builder it will apply for all buttons that are using this theme.

Let me know if you have additional questions.

Regards,
Dimitar
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
Buttons, RadioButton, CheckBox, etc
Asked by
Maher Khalil
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or