Question

On the xctk:IntegerUpDown, I would like the textbox border and the ButtonSpinner to only be visible when focused or mouseover. It is easy enough to turn the border on/off using a <Style.Triggers> section. It is also possible to control the ShowButtonSpinner property.

However, the content of the TextBox jumps to the right if I set ShowButtonSpinner=False. I would like to simply hide the ButtonSpinner without TextBox contents jumping around.

Like this:

enter image description here

How can I get access to the appropriate property?

No correct solution

OTHER TIPS

your question helped me to find ShowButtonSpinner property which I needed to hide up and down buttons

i can suggest a workaround with setting a fixed Padding for content when buttons are hidden. Value 0,0,17,0 seems ok to me (Win7, wpf toolkit version v2.6.0.0)

<xctk:IntegerUpDown.Style>
    <Style TargetType="xctk:IntegerUpDown">
        <Setter Property="Padding" Value="0,0,17,0"/>
        <Setter Property="ShowButtonSpinner" Value="False"/>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Padding" Value="0"/>
                <Setter Property="ShowButtonSpinner" Value="True"/>
            </Trigger>
        </Style.Triggers>
    </Style>
</xctk:IntegerUpDown.Style>

another simple thing is to align text to left side via property

<xctk:IntegerUpDown TextAlignment="Left"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top