This example demonstrates how to disable EnableDefaultAppearance of ASPxButton and define a custom style for it.
- Set the ASPxButton.EnableDefaultAppearance property to "false" to completely define a button style either via css or appropriate style properties;
- Define a custom css class or set style properties for the button;
Css:
[CSS]
.customButton{background-color:Red;cursor:pointer;font-weight:bold;border:3pxsolid#b3b4c3;border-right:3pxsolid#090e61;border-bottom:3pxsolid#090e61;}
[ASPx]
<dx:ASPxButtonEnableDefaultAppearance="false"CssClass="customButton"...>
...</dx:ASPxButton>
Properties:
[ASPx]
<dx:ASPxButtonEnableDefaultAppearance="false"Cursor="pointer"Width="160"Height="30"...>
...</dx:ASPxButton>
- Define (if needed) custom css classes or properties for PressedStyle, DisabledStyle, HoverStyle, and CheckedStyle to create different styles for each state;
- Define (if needed) the FocusRectBorder properties.
[CSS]
.customButtonPressed{background-color:#AA0000;}
[ASPx]
<dx:ASPxButton...EnableDefaultAppearance="false"CssClass="customButton"...><PressedStyleCssClass="customButtonPressed"></PressedStyle><HoverStyleBackColor="#FF4040"></HoverStyle>
... <FocusRectBorderBorderWidth="1"BorderStyle="Dotted"BorderColor="White"/></dx:ASPxButton>