locked
Make smaller a button in the pressed event

    Question

  • This is the pressed event of my button's style. How can I make smaller my button?

    <VisualState x:Name="Pressed">
                                            <Storyboard>

                                            </Storyboard>

                                                
    Friday, September 21, 2012 2:42 PM

Answers

  • Hi,

    Please follow these codes.

           <Button x:Name="button1" Content="Button" HorizontalAlignment="Left" Margin="809,194,0,0" VerticalAlignment="Top" Click="Button_Click_1" Width="100" Height="100">
                <Button.Resources>
                    <Storyboard x:Name="buttonclick">
                        <DoubleAnimation 
                  Storyboard.TargetName="button1"
                  Storyboard.TargetProperty="Width"
                  From="100" To="50" Duration="0:0:1"
                  EnableDependentAnimation="True"
                 />
                        <DoubleAnimation
                  Storyboard.TargetName="button1"
                  Storyboard.TargetProperty="Height"
                  From="100" To="50" Duration="0:0:1"
                  EnableDependentAnimation="True"
                 />
                    </Storyboard>
                </Button.Resources>
            </Button>
    In Button_Click_1 event
    buttonclick->Begin();


    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Jesse Jiang Thursday, September 27, 2012 2:56 AM
    Monday, September 24, 2012 5:54 AM