Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8685295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:31:55+00:00 2026-06-12T22:31:55+00:00

Please check the below example first animation example i want to do this in

  • 0

Please check the below example first

animation example

i want to do this in my wpf windows application. plz help me

i am using 3 buttons in grid.row=”0″
and three stack panels in grid.row=”1″

when user clicks on any button the appropriate stack panel should move in and and other should move out.

I am new to WPF and i tried below.

<Grid>

    <Grid.Triggers>
        <EventTrigger SourceName="btnPNB" RoutedEvent="Button.Click">
            <EventTrigger.Actions>
                <BeginStoryboard x:Name="StoryBoard1">
                    <Storyboard>
                        <DoubleAnimation x:Name="dbMoveOut" Storyboard.TargetName="sPanelPNB" 
                                         Storyboard.TargetProperty="RenderTransform.(TranslateTransform.X)" 
                                         From="0" To="600" AutoReverse="False">
                        </DoubleAnimation>
                        <DoubleAnimation x:Name="dbMoveIn" Storyboard.TargetName="sPanelOtherBank" 
                                         Storyboard.TargetProperty="RenderTransform.(TranslateTransform.X)" 
                                         From="-550" To="0" AutoReverse="False">
                        </DoubleAnimation>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger.Actions>
        </EventTrigger>
        <EventTrigger SourceName="btnOther" RoutedEvent="Button.Click">
            <EventTrigger.Actions>
                <BeginStoryboard x:Name="StoryBoard2">
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetName="sPanelOtherBank" 
                                         Storyboard.TargetProperty="RenderTransform.(TranslateTransform.X)" 
                                         From="-550" To="0" AutoReverse="False">
                        </DoubleAnimation>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger.Actions>
        </EventTrigger>
        <EventTrigger SourceName="btnCAIIB" RoutedEvent="Button.Click">
            <EventTrigger.Actions>
                <BeginStoryboard x:Name="StoryBoard3">
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetName="sPanelCAIIB" 
                                         Storyboard.TargetProperty="RenderTransform.(TranslateTransform.X)" 
                                         From="-550" To="0" AutoReverse="False">
                        </DoubleAnimation>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger.Actions>
        </EventTrigger>
    </Grid.Triggers>

    <Button x:Name="btnPNB" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="20,0,0,0" Content="PNB" Click="moveSP_Click"></Button>
    <Button x:Name="btnOther" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="70,0,0,0" Content="OTher"  Click="moveSP_Click"></Button>
    <Button x:Name="btnCAIIB" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="150,0,0,0" Content="CAIIB" Click="moveSP_Click"></Button>

    <StackPanel x:Name="sPanelPNB" VerticalAlignment="Bottom" Orientation="Horizontal">
        <StackPanel.RenderTransform>
            <TranslateTransform X="-550" Y="0"></TranslateTransform>
        </StackPanel.RenderTransform>
        <Image Source="1_1.jpg" Margin="10,0,0,0" Width="100" HorizontalAlignment="Left" VerticalAlignment="Bottom">
        </Image>
        <Image Source="1_2.png" Width="100" Margin="50,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">
        </Image>
        <Image Source="1_3.png" Width="100" Margin="50,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">
        </Image>
    </StackPanel>

    <StackPanel x:Name="sPanelOtherBank" VerticalAlignment="Bottom" Orientation="Horizontal">
        <StackPanel.RenderTransform>
            <TranslateTransform X="-550" Y="0"></TranslateTransform>
        </StackPanel.RenderTransform>
        <Image Source="2_1.png" Margin="10,0,0,0" Width="100" HorizontalAlignment="Left" VerticalAlignment="Bottom">
        </Image>
        <Image Source="2_2.jpg" Width="100" Margin="50,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">
        </Image>
        <Image Source="2_3.png" Width="100" Margin="50,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">
        </Image>
    </StackPanel>

    <StackPanel x:Name="sPanelCAIIB" VerticalAlignment="Bottom" Orientation="Horizontal">
        <StackPanel.RenderTransform>
            <TranslateTransform X="-550" Y="0"></TranslateTransform>
        </StackPanel.RenderTransform>
        <Image Source="3_1.png" Margin="10,0,0,0" Width="100" HorizontalAlignment="Left" VerticalAlignment="Bottom">
        </Image>
        <Image Source="3_2.png" Width="100" Margin="50,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">
        </Image>
        <Image Source="3_3.jpg" Width="100" Margin="50,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">
        </Image>
    </StackPanel>




</Grid>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:31:56+00:00Added an answer on June 12, 2026 at 10:31 pm

    Here is what you want. You have update your panels everytime. And I personally, would add duration. But in this example you will notice your panels if you resize your window

    <Grid>
        <Grid.Triggers>
            <EventTrigger SourceName="btnRed" RoutedEvent="Button.Click">
                <EventTrigger.Actions>
                    <BeginStoryboard x:Name="StoryBoard1">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="sPanelRed"
                                         Storyboard.TargetProperty="RenderTransform.(TranslateTransform.X)" 
                                         To="0"/>
                            <DoubleAnimation Storyboard.TargetName="sPanelBlue"
                                         Storyboard.TargetProperty="RenderTransform.(TranslateTransform.X)" 
                                         To="-550"/>
                            <DoubleAnimation Storyboard.TargetName="sPanelBlack"
                                         Storyboard.TargetProperty="RenderTransform.(TranslateTransform.X)" 
                                         To="-550"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger.Actions>
            </EventTrigger>
            <EventTrigger SourceName="btnBlue" RoutedEvent="Button.Click">
                <EventTrigger.Actions>
                    <BeginStoryboard x:Name="StoryBoard2">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="sPanelRed"
                                         Storyboard.TargetProperty="RenderTransform.(TranslateTransform.X)" 
                                         To="600" AutoReverse="False"/>
                            <DoubleAnimation Storyboard.TargetName="sPanelBlue"
                                         Storyboard.TargetProperty="RenderTransform.(TranslateTransform.X)" 
                                         To="0"/>
                            <DoubleAnimation Storyboard.TargetName="sPanelBlack"
                                         Storyboard.TargetProperty="RenderTransform.(TranslateTransform.X)" 
                                         To="-550"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger.Actions>
            </EventTrigger>
            <EventTrigger SourceName="btnBlack" RoutedEvent="Button.Click">
                <EventTrigger.Actions>
                    <BeginStoryboard x:Name="StoryBoard3">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="sPanelRed"
                                         Storyboard.TargetProperty="RenderTransform.(TranslateTransform.X)" 
                                         To="600"/>
                            <DoubleAnimation Storyboard.TargetName="sPanelBlue"
                                         Storyboard.TargetProperty="RenderTransform.(TranslateTransform.X)" 
                                         To="600"/>
                            <DoubleAnimation Storyboard.TargetName="sPanelBlack"
                                         Storyboard.TargetProperty="RenderTransform.(TranslateTransform.X)" 
                                         To="0"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger.Actions>
            </EventTrigger>
        </Grid.Triggers>
    
        <Button x:Name="btnRed" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="20,0,0,0" Content="show red"></Button>
        <Button x:Name="btnBlue" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,359,0" Content="show blue"></Button>
        <Button x:Name="btnBlack" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,279,0" Content="show black"></Button>
        <StackPanel x:Name="sPanelRed" VerticalAlignment="Bottom" Orientation="Horizontal" Height="10" Background="Red">
            <StackPanel.RenderTransform>
                <TranslateTransform X="-550" Y="0"></TranslateTransform>
            </StackPanel.RenderTransform>
        </StackPanel>
    
        <StackPanel x:Name="sPanelBlue" VerticalAlignment="Bottom" Orientation="Horizontal" Height="10" Background="Blue">
            <StackPanel.RenderTransform>
                <TranslateTransform X="-550" Y="0"></TranslateTransform>
            </StackPanel.RenderTransform>
        </StackPanel>
    
        <StackPanel x:Name="sPanelBlack" VerticalAlignment="Bottom" Orientation="Horizontal" Height="10" Background="Black">
            <StackPanel.RenderTransform>
                <TranslateTransform X="-550" Y="0"></TranslateTransform>
            </StackPanel.RenderTransform>
        </StackPanel>
    </Grid>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

please check the below example namespace GServices { [ServiceKnownType(typeof(SearchType))] [ServiceContract(SessionMode = SessionMode.Allowed)] public interface
I am stuck with FIND_IN_SET function in MYSQL 5.5, For example: Please check below
I'm a bit confused about the object references. Please check the examples below: class
Please check below screen shot. What is main difference between Master Page and MVC
Please check my HTML below: <table cellpadding=0 cellpadding=0 border=0> <tr> <td> <div class=toogler>Demo1</div> </td>
I had a weird problem here. Please check the code below. I do not
Please check this code out it compiles and runs absolutely fine.. The question is
Please check the following example: http://www.esaer.com.br/csstest/ If the vertical scrollbar doesn't appear, please resize
I have an issue with this jquery code below. Please give me advice or
The first example below is #62 from John Resign`s Learning Advanced JavaScript http://ejohn.org/apps/learn/#62 .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.