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

How can I use button's hover style?

1 Answer 19 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
tomekm asked on 01 Jul 2011, 10:34 AM
I use FormDecorator to style buttons in my application with Office2007 skin. I especially like effect that hovered buttons have. Can I set in code behind that not-hovered button will look like hovered somehow?

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 04 Jul 2011, 10:45 AM
Hello Rychu,

You could not do that through the code behind, but you should create some custom CSS that will force the normal state button to use the hover states background positions:

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<head id="Head1" runat="server">
    <style type="text/css">
        .RadForm_Office2007.rfdButton input[type="button"].rfdDecorated,
        .RadForm_Office2007.rfdButton input[type="reset"].rfdDecorated,
        .RadForm_Office2007.rfdButton input[type="submit"].rfdDecorated,
        .RadForm_Office2007.rfdButton .rfdSkinnedButton button,
        .RadForm_Office2007.rfdButton a.rfdInputDisabled.rfdSkinnedButton:hover *
            background-position: left -66px;
        .RadForm_Office2007.rfdButton a.rfdSkinnedButton,
        .RadForm_Office2007.rfdButton a.rfdInputDisabled.rfdSkinnedButton:hover
             background-position: right -44px;
    <form id="form1" runat="server">
    <asp:ScriptManager ID="rs1" runat="server">
    <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All"
        Skin="Office2007" />
    <asp:Button ID="btn1" runat="server" Text="Button" />

Best wishes,
the Telerik team
Explore the entire set of ASP.NET AJAX controls we offer here and browse the myriad online demos to learn more about the components and the features they incorporate.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question