Hover Color

2 posts, 1 answers
  1. Maher Khalil
    Maher Khalil avatar
    11 posts
    Member since:
    Oct 2009

    Posted 02 Jun 2014 Link to this post

    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
  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 05 Jun 2014 Link to this post

    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.
     
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top