Skip to main content
All docs
V25.1
  • Calculator.DigitButtonStyle Property

    Gets or sets the Calculator’s digit button style. This is a dependency property.

    Namespace: DevExpress.Xpf.Editors

    Assembly: DevExpress.Xpf.Core.v25.1.dll

    NuGet Package: DevExpress.Wpf.Core

    Declaration

    public Style DigitButtonStyle { get; set; }

    Property Value

    Type Description
    Style

    The Calculator’s digit button style.

    Remarks

    The following code sample specifies the DigitButtonStyle, CEButtonStyle, OperationButtonStyle, and CornerRadius properties.

    <Window ...
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
        xmlns:dxet="http://schemas.devexpress.com/winfx/2008/xaml/editors/themekeys">
        <StackPanel>
            <StackPanel.Resources>
                <ResourceDictionary>
                    <ResourceDictionary.MergedDictionaries>
                        <ResourceDictionary Source="/DevExpress.Xpf.Themes.Office2019Colorful.v20.2;component/Core/Core/Editors/Themes/Generic/Generic.xaml"/>
                    </ResourceDictionary.MergedDictionaries>
                <Style x:Key="digitStyle" TargetType="Button" BasedOn="{StaticResource {dxet:CalculatorThemeKey ResourceKey=ButtonDigitStyle, ThemeName=Office2019Colorful}}">
                    <Setter Property="Background" Value="#FFFCFCFC" />
                    <Setter Property="Padding" Value="5,15"/>
                    <Setter Property="BorderBrush" Value="Transparent" />
                    <Setter Property="FontSize" Value="12"/>
                    <Setter Property="FontWeight" Value="Bold"/>
                    <Style.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" Value="#FFE1E1E1" />
                            <Setter Property="BorderBrush" Value="Transparent" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Background" Value="#FFCBCBCB" />
                            <Setter Property="BorderBrush" Value="Transparent" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
                <Style x:Key="operationStyle" TargetType="Button" BasedOn="{StaticResource {dxet:CalculatorThemeKey ResourceKey=ButtonOperationStyle, ThemeName=Office2019Colorful}}">
                    <Setter Property="Background" Value="#FFF7F7F7" />
                    <Setter Property="Padding" Value="5,15"/>
                    <Setter Property="BorderBrush" Value="Transparent" />
                    <Style.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" Value="#FFE1E1E1" />
                            <Setter Property="BorderBrush" Value="Transparent" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Background" Value="#FFCBCBCB" />
                            <Setter Property="BorderBrush" Value="Transparent" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
                <Style x:Key="ceStyle" TargetType="Button" BasedOn="{StaticResource {dxet:CalculatorThemeKey ResourceKey=ButtonCEStyle, ThemeName=Office2019Colorful}}">
                    <Setter Property="Background" Value="#FFF7F7F7" />
                    <Setter Property="Padding" Value="5,15"/>
                    <Setter Property="BorderBrush" Value="Transparent" />
                    <Style.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" Value="#FFE1E1E1" />
                            <Setter Property="BorderBrush" Value="Transparent" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Background" Value="#FFCBCBCB" />
                            <Setter Property="BorderBrush" Value="Transparent" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
                </ResourceDictionary>
            </StackPanel.Resources>
            <dxe:Calculator Background="#FFF2F2F2"
                            CornerRadius="10"
                            DigitButtonStyle="{StaticResource digitStyle}"
                            OperationButtonStyle="{StaticResource operationStyle}"
                            CEButtonStyle="{StaticResource ceStyle}" />
        </StackPanel>
    </Window>
    

    Calculator - Appearance Properties

    Note

    The property is supported in the following DevExpress themes:

    Theme Family Themes
    Windows 11 Dark, Light
    Windows 10 Dark, Light
    Office 2019 Black, Colorful, Dark Gray, White, HighContrast
    Visual Studio 2019 Blue, Dark, Light
    Office 2016 SE Black, Colorful, Dark Gray, White
    Visual Studio 2017 Blue, Dark, Light
    See Also