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 959113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:58:27+00:00 2026-05-16T00:58:27+00:00

If I have something like: <StackPanel Orientation=Horizontal> <TextBlock Text=FIRST Margin=5 VerticalAlignment=Center /> <TextBlock Text=SECOND

  • 0

If I have something like:

<StackPanel Orientation="Horizontal">
    <TextBlock Text="FIRST"  Margin="5" VerticalAlignment="Center" />
    <TextBlock Text="SECOND" Margin="5" VerticalAlignment="Center" />
    <TextBlock Text="THIRD"  Margin="5" VerticalAlignment="Center" />
    <TextBlock Text="FOURTH" Margin="5" VerticalAlignment="Center" />
    <TextBlock Text="FIFTH"  Margin="5" VerticalAlignment="Center" />
</StackPanel>

Could you please show me how can I create an animation where TextBlocks will roll out from the right side of the screen, each after another?

Could you show me a similar example?

I know that I probably gonna need to use Canvas instead of StackPanel, but how to arrange them properly then I don’t know…

  • 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-05-16T00:58:28+00:00Added an answer on May 16, 2026 at 12:58 am

    Here is a two-example answer. If you truly want to use TextBlocks in a StackPanel, I’ve shown that. However, if you are actually looking for a menu, I’ve included that example as well. Both examples are really the same – just the object that gets animated changes.

    <DockPanel HorizontalAlignment="Stretch" 
               VerticalAlignment="Stretch" 
               ClipToBounds="True">
        <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
            <TextBlock Text="FIRST"  Margin="5" VerticalAlignment="Center" />
            <TextBlock Text="SECOND" Margin="5" VerticalAlignment="Center" />
            <TextBlock Text="THIRD"  Margin="5" VerticalAlignment="Center" />
            <TextBlock Text="FOURTH" Margin="5" VerticalAlignment="Center" />
            <TextBlock Text="FIFTH"  Margin="5" VerticalAlignment="Center" />
            <StackPanel.RenderTransform>
                <TranslateTransform x:Name="translateTransform"
                                    X="{Binding Path=ActualWidth,
                                                RelativeSource={RelativeSource FindAncestor,
                                                                               AncestorType={x:Type DockPanel}}}" />
            </StackPanel.RenderTransform>
            <StackPanel.Triggers>
                <EventTrigger RoutedEvent="StackPanel.Loaded">
                    <EventTrigger.Actions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="translateTransform"
                                                 Storyboard.TargetProperty="(TranslateTransform.X)"
                                                 To="0"
                                                 BeginTime="0:0:0.5"
                                                 AutoReverse="False"
                                                 Duration="0:0:2.5" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </EventTrigger>
            </StackPanel.Triggers>
        </StackPanel>
    
        <Menu DockPanel.Dock="Top">
            <MenuItem Header="First" />
            <MenuItem Header="Second" />
            <MenuItem Header="Third" />
            <MenuItem Header="Fourth" />
            <MenuItem Header="Fifth" />
            <Menu.RenderTransform>
                <TranslateTransform x:Name="translateTransform2"
                                    X="{Binding Path=ActualWidth,
                                                RelativeSource={RelativeSource FindAncestor,
                                                                               AncestorType={x:Type DockPanel}}}" />
            </Menu.RenderTransform>
            <Menu.Triggers>
                <EventTrigger RoutedEvent="Menu.Loaded">
                    <EventTrigger.Actions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="translateTransform2"
                                                 Storyboard.TargetProperty="(TranslateTransform.X)"
                                                 To="0"
                                                 BeginTime="0:0:3.5"
                                                 AutoReverse="False"
                                                 Duration="0:0:2.5" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </EventTrigger>
            </Menu.Triggers>
        </Menu>
    
        <Grid>
            <TextBlock FontSize="25"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Text="Content Goes Here" />
        </Grid>
    
    </DockPanel>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set my ListBox.ItemTemplate to something like below <ListBox.ItemTemplate> <DataTemplate> <StackPanel Margin=10> <TextBlock
I have a group of components like so: <StackPanel Orientation=Horizontal > <Label>Between</Label> <DatePicker Name=dtpFrom
I have wpf user control <StackPanel Orientation=Horizontal> <TextBox Name=txbInterval Text=5/> <Image Name=imgStart Source=Images/start.png/> <Image
Say I've got some TextBlocks on my UI, something like so: <StackPanel Orientation=Vertical> <TextBlock
I have this PivotItem: <controls:PivotItem Header=Biografie> <StackPanel> <ScrollViewer x:Name=textScroller Margin=10,0,10,0> <TextBlock Text={Binding Biography} TextWrapping=Wrap/>
I have something like this : code.js var params = { option1 : encodeURIComponent(text\n
When i write something like this: <Style x:Key=panelS> <Setter Property=Orientation Value=Horizontal /> <Setter Property=DockPanel.Dock
I have a combo box with the following DataTemplate: <DataTemplate x:Key=ComboBoxDataTemplate> <StackPanel> <TextBlock Text={Binding
I have something like this: function showFunction () { // need position and place
I have something like the code below: for(int i=0;i<10;i++){ button=new JButton(buttons[i]); button.addActionListener(new ActionListener(){ public

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.