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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:35:46+00:00 2026-05-11T10:35:46+00:00

HI I am new to WPF and I am looking for a solution to

  • 0

HI
I am new to WPF and I am looking for a solution to scroll text in a WPF application,
I tried some animation but I have a clipping problem
I found a possible solution to my problem in the following place:

http://social.msdn.microsoft.com/forums/en-US/wpf/thread/8330696e-7715-479e-8027-8d9925579a17/

but it is not clear to me what the variables TranslateTransformName, scrollfactor and tt should be..
Can somebody look at the code and help me to figure it out?
thanks

Wally

this is the code there: Code Block

<p class=MsoNoSpacing>&lt;     <span class=SpellE>Viewbox</span>     <span class=SpellE>OpacityMask</span> =&quot;{x     <span class=GramE>:Null</span> }&quot;     <span class=SpellE>HorizontalAlignment</span> =&quot;Center&quot;     <span class=SpellE>VerticalAlignment</span> =&quot;Stretch&quot; Width=&quot;Auto&quot; Height=&quot;Auto&quot;     <span class=SpellE>RenderTransformOrigin</span> =&quot;0.5,0.5&quot; x:Name=&quot;container&quot; Stretch=&quot;Uniform&quot;     <span class=SpellE>StretchDirection</span> =&quot;Both&quot;&gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'></span> &lt;     <span class=SpellE>Viewbox.RenderTransform</span> &gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'></span> &lt;     <span class=SpellE>TransformGroup</span> &gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'>     </span> &lt;     <span class=SpellE>ScaleTransform</span>     <span class=SpellE>ScaleX</span> =&quot;1&quot;     <span class=SpellE>ScaleY</span> =&quot;1&quot;/&gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'>     </span> &lt;     <span class=SpellE>SkewTransform</span>     <span class=SpellE>AngleX</span> =&quot;0&quot;     <span class=SpellE>AngleY</span> =&quot;0&quot;/&gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'>     </span> &lt;     <span class=SpellE>RotateTransform</span> Angle=&quot;0&quot;/&gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'>     </span> &lt;     <span class=SpellE>TranslateTransform</span> X=&quot;640&quot; Y=&quot;0&quot;/&gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'></span> &lt;/     <span class=SpellE>TransformGroup</span> &gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'></span> &lt;/     <span class=SpellE>Viewbox.RenderTransform</span> &gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'></span> &lt;     <span class=SpellE>TextBlock</span>     <span class=SpellE>RenderTransformOrigin</span> =&quot;0.5     <span class=GramE>,0.5</span> &quot;     <span class=SpellE>HorizontalAlignment</span> =&quot;Center&quot; x:Name=&quot;     <span class=SpellE>tb</span> &quot;     <span class=SpellE>VerticalAlignment</span> =&quot;Center&quot; Width=&quot;Auto&quot; Height=&quot;Auto&quot;     <span class=SpellE>FontSize</span> =&quot;50&quot;     <span class=SpellE>TextWrapping</span> =&quot;     <span class=SpellE>NoWrap</span> &quot; Background=&quot;{x:Null}&quot; Foreground=&quot;#FFFFFFFF&quot; Padding=&quot;0,0,0,10&quot; Text=&quot;0&quot;&gt; </p>  <p class=MsoNoSpacing></p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'></span> &lt;     <span class=SpellE>TextBlock.RenderTransform</span> &gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'>     </span> &lt;     <span class=SpellE>TransformGroup</span> &gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'>     </span> &lt;     <span class=SpellE>ScaleTransform</span>     <span class=SpellE>ScaleX</span> =&quot;1&quot;     <span class=SpellE>ScaleY</span> =&quot;1&quot;/&gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'>     </span> &lt;     <span class=SpellE>SkewTransform</span>     <span class=SpellE>AngleX</span> =&quot;0&quot;     <span class=SpellE>AngleY</span> =&quot;0&quot;/&gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'>     </span> &lt;     <span class=SpellE>RotateTransform</span> Angle=&quot;0&quot;/&gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'>     </span> &lt;     <span class=SpellE>TranslateTransform</span> X=&quot;640&quot; Y=&quot;0&quot;/&gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'>     </span> &lt;/     <span class=SpellE>TransformGroup</span> &gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'></span> &lt;/     <span class=SpellE>TextBlock.RenderTransform</span> &gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'></span> &lt;/     <span class=SpellE>TextBlock</span> &gt; </p>  <p class=MsoNoSpacing>     <span style='mso-spacerun:yes'></span> &lt;/     <span class=SpellE>Viewbox</span> &gt; </p>  <p class=MsoNoSpacing>     <o:p>&nbsp;</o:p> </p>  <p class=MsoNoSpacing>     <o:p>&nbsp;</o:p> </p>  <p class=MsoNoSpacing>     <o:p>&nbsp;</o:p> </p>  <p class=MsoNoSpacing>     <o:p>&nbsp;</o:p> </p> 

Code Block private void StartAnimation(object sender, EventArgs e) { tb.Text = news;

        MainWindow.UpdateLayout();          Double timeToTake = (MainWindow.Width + tb.ActualWidth) / scrollfactor;          this.tb.RenderTransform = tt;         Storyboard sb = new Storyboard();          DoubleAnimation daX = new DoubleAnimation(MainWindow.Width, (0.0 - tb.ActualWidth), new Duration(TimeSpan.FromSeconds(timeToTake)));         daX.RepeatBehavior = RepeatBehavior.Forever;          Storyboard.SetTargetName(daX, TranslateTransformName);         Storyboard.SetTargetProperty(daX, new PropertyPath(TranslateTransform.XProperty));         sb.Children.Add(daX);         sb.Begin(this.tb);     } 
  • 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. 2026-05-11T10:35:47+00:00Added an answer on May 11, 2026 at 10:35 am

    http://jobijoy.blogspot.com/2008/08/wpf-custom-controls-marquee-control.html

    You can check the idea behind this Marquee control. When you say to scroll the text inside the textBlock.. think about scrolling a long textblock inside a marqueee control. This control is a ContentControl which can scroll any Content inside.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm fairly new to WPF and looking for a simple solution to the problem
I new to WPF C# and I'm looking for some direction. I have a
I have been playing with the new Microsoft Ribbon for WPF and looking at
While designing a new WPF application I noticed exceptions not being thrown during data
Doing the below will reproduce my problem: New WPF Project Add ListView Name the
New to wpf and through a learning curve. I have a userControl with a
being new to WPF this is a complex problem for me. What i want
I'm new to WPF. I have a WPF Window with a bunch of Labels
I am new to WPF. I have a ListBox that has its ItemSource set
In my application (WPF) i have this window: public partial class Window1 : Window

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.