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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:39:23+00:00 2026-05-27T09:39:23+00:00

I have a TextBlock on my page with Text value null (). When I

  • 0

I have a TextBlock on my page with Text value null (“”). When I click a button I want to change the Text value for this TextBlock, pause half a second and then move the TextBlock one pixel at a time to a certain point.

I tried using Thread.Sleep(), but so far, I have a problem. I click the button, the UI thread pauses for half a second, then the TextBlock suddenly appears and starts moving. I want it to appear as soon as I click the button.

P.S.: I know Thread.Sleep() doesn’t work. I am willing to use anything that works.

  • 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-27T09:39:23+00:00Added an answer on May 27, 2026 at 9:39 am

    Storyboards and animations are the preferred mechanism for moving items on the screen. For one thing, they are optimized to work with the phones threading model. For another, putting your UI thread to sleep is a bad idea as you are making a non responsive application.

    Here’s a quick example of how to move a texblock with a story board.

    The UI elements.

     <Grid
      x:Name="ContentPanel"
      Grid.Row="1"
      Margin="12,0,12,0">
      <TextBlock
        Margin='79,263,177,307'
        Name='textBlock1'
        Text='TextBlock'
        RenderTransformOrigin="0.5,0.5">
        <TextBlock.RenderTransform>
            <CompositeTransform />
        </TextBlock.RenderTransform>
      </TextBlock>
      <Button
        Content="Button"
        Height="80"
        Margin="116,0,188,144"
        VerticalAlignment="Bottom"
        Click='Button_Click' />
    </Grid>
    

    The storyboard, defined in the page resources section.

     <phone:PhoneApplicationPage.Resources>
    <Storyboard
      x:Name="MoveTextBlockStoryboard">
      <DoubleAnimationUsingKeyFrames
        Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"
        Storyboard.TargetName="textBlock1">
        <EasingDoubleKeyFrame
          KeyTime="0"
          Value="0" />
        <EasingDoubleKeyFrame
          KeyTime="0:0:1.1"
          Value="120" />
      </DoubleAnimationUsingKeyFrames>
      <DoubleAnimationUsingKeyFrames
        Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"
        Storyboard.TargetName="textBlock1">
        <EasingDoubleKeyFrame
          KeyTime="0"
          Value="0" />
        <EasingDoubleKeyFrame
          KeyTime="0:0:1.1"
          Value="-105" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    

    The code that changes the text and starts the storyboard.

    private void Button_Click(object sender, RoutedEventArgs e) {
      textBlock1.Text = "new text";
      MoveTextBlockStoryboard.Begin();
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following XAML: <TextBlock Text={Binding ElementName=EditListBox, Path=SelectedItems.Count} Margin=0,0,5,0/> <TextBlock Text=items selected> <TextBlock.Style>
We have two textBlocks like this: (we used .NET FW 3.0) <TextBlock Grid.Column=0 Name=tabName
I have a text block on my page. Basically, I'd like to allow the
I am completely new developer at Windows Phone 7. I have TextBlock Text={Binding MyDate}
I have a bunch (currently) HyperlinkButtons on my main web page. I want to
I have this code in a xaml page: <ListBox Height=524 HorizontalAlignment=Left Margin=12,6,0,0 Name=listBox1 VerticalAlignment=Top
I'm writing a WP7 app and on a certain page I have a TextBlock
I have a page so far with: <div id=x1>Text paragraph 1<link here></div> <div id=x2>Text
How to access textBlock from another xaml window? I have the Main Page and
I have a XAML page with lots of images. When a textBlock is loaded,

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.