Basic WPF Animation QuestionHow can I scroll the label within the border element. I want it to scroll so it roll off the left and eventually comes back on the right (similar to having a scroll tag within a td).   I'm hitting a brick wall at stage one, I figure this would happen by manipulating the margin property (via animation eventually) however say I set to -5,-5,-0,0 it doesn't clip it just moves it out of the element? <br><br> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">&lt;Grid&gt;<br>      &lt;Border Margin=&quot;20,20,20,20&quot; BorderThickness=&quot;2&quot; BorderBrush=&quot;#78C730&quot;&gt;<br><br>        &lt;Label&gt;Scrolling Text&lt;/Label&gt;<br>      &lt;/Border&gt;<br>        <br>    &lt;/Grid&gt;<br></span></div> <p></p></div></div>© 2009 Microsoft Corporation. All rights reserved.Thu, 19 Jun 2008 00:15:52 Z0258951a-5e40-487a-a752-c8c30f1922d9http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/0258951a-5e40-487a-a752-c8c30f1922d9#0258951a-5e40-487a-a752-c8c30f1922d9http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/0258951a-5e40-487a-a752-c8c30f1922d9#0258951a-5e40-487a-a752-c8c30f1922d9MattCheshirehttp://social.msdn.microsoft.com/Profile/en-US/?user=MattCheshireBasic WPF Animation QuestionHow can I scroll the label within the border element. I want it to scroll so it roll off the left and eventually comes back on the right (similar to having a scroll tag within a td).   I'm hitting a brick wall at stage one, I figure this would happen by manipulating the margin property (via animation eventually) however say I set to -5,-5,-0,0 it doesn't clip it just moves it out of the element? <br><br> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">&lt;Grid&gt;<br>      &lt;Border Margin=&quot;20,20,20,20&quot; BorderThickness=&quot;2&quot; BorderBrush=&quot;#78C730&quot;&gt;<br><br>        &lt;Label&gt;Scrolling Text&lt;/Label&gt;<br>      &lt;/Border&gt;<br>        <br>    &lt;/Grid&gt;<br></span></div> <p></p></div></div>Fri, 20 Jul 2007 23:05:12 Z2007-07-26T03:12:23Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/0258951a-5e40-487a-a752-c8c30f1922d9#064190fc-3290-4e5f-a008-5be498e3a688http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/0258951a-5e40-487a-a752-c8c30f1922d9#064190fc-3290-4e5f-a008-5be498e3a688Matt Hohn - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Matt%20Hohn%20-%20MSFTBasic WPF Animation Question<p>Is this what you wanted?  May be a little rough, but you can clean the code up if this is what you want...</p> <p> </p> <p> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">Code Snippet</span></div> <p>     &lt;Border x:Name=&quot;border&quot; Margin=&quot;20,20,20,20&quot; BorderThickness=&quot;2&quot; BorderBrush=&quot;#78C730&quot;&gt;</p> <p>        &lt;Label x:Name=&quot;label&quot;&gt;<br>            &lt;Label.RenderTransform&gt;<br>                &lt;TranslateTransform x:Name=&quot;translate2&quot; /&gt;<br>            &lt;/Label.RenderTransform&gt;<br>            &lt;Label.Triggers&gt;<br>                &lt;EventTrigger RoutedEvent=&quot;FrameworkElement.Loaded&quot;&gt;<br>                    &lt;BeginStoryboard&gt;<br>                        &lt;Storyboard RepeatBehavior=&quot;Forever&quot;&gt;<br>                            &lt;DoubleAnimation <br>                                From=&quot;{Binding ElementName=border, Path=ActualWidth}&quot; To=&quot;-300&quot; <br>                                Storyboard.TargetName=&quot;translate2&quot; <br>                                Storyboard.TargetProperty=&quot;X&quot;<br>                                Duration=&quot;0:0:5&quot; /&gt;<br>                        &lt;/Storyboard&gt;<br>                    &lt;/BeginStoryboard&gt;<br>                &lt;/EventTrigger&gt;<br>            &lt;/Label.Triggers&gt;Scrolling Text&lt;/Label&gt;<br>      &lt;/Border&gt;<br></p></div></div> <p> </p> <p></p> <p> </p>Sat, 21 Jul 2007 15:20:45 Z2007-07-21T15:20:45Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/0258951a-5e40-487a-a752-c8c30f1922d9#bc5beb1d-c7f4-4b59-bf05-fd40a7ed4f53http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/0258951a-5e40-487a-a752-c8c30f1922d9#bc5beb1d-c7f4-4b59-bf05-fd40a7ed4f53MattCheshirehttp://social.msdn.microsoft.com/Profile/en-US/?user=MattCheshireBasic WPF Animation QuestionMany thanks John, however its not quite what I want.<br><br>When the text scrolls over the border brush line it should disspear (like the border region is the only visible part one should be able to see the text)? <br>Sat, 21 Jul 2007 15:52:07 Z2007-07-21T15:52:07Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/0258951a-5e40-487a-a752-c8c30f1922d9#ed229214-3553-482f-951d-22a30a0bf41chttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/0258951a-5e40-487a-a752-c8c30f1922d9#ed229214-3553-482f-951d-22a30a0bf41cMatt Hohn - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Matt%20Hohn%20-%20MSFTBasic WPF Animation Question<p>Maybe this will work..  setting ClipToBounds on the Border element</p> <p> </p> <p><br> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">Code Snippet</span></div> <p>        &lt;Border Width=&quot;150&quot; Height=&quot;150&quot; x:Name=&quot;border&quot; Margin=&quot;20,20,20,20&quot; ClipToBounds=&quot;true&quot; BorderThickness=&quot;2&quot; BorderBrush=&quot;#78C730&quot;&gt;</p> <p>        &lt;Label x:Name=&quot;label&quot;&gt;<br>            &lt;Label.RenderTransform&gt;<br>                &lt;TranslateTransform x:Name=&quot;translate2&quot; /&gt;<br>            &lt;/Label.RenderTransform&gt;<br>            &lt;Label.Triggers&gt;<br>                &lt;EventTrigger RoutedEvent=&quot;FrameworkElement.Loaded&quot;&gt;<br>                    &lt;BeginStoryboard&gt;<br>                        &lt;Storyboard RepeatBehavior=&quot;Forever&quot;&gt;<br>                            &lt;DoubleAnimation <br>                                From=&quot;{Binding ElementName=border, Path=ActualWidth}&quot; To=&quot;-300&quot; <br>                                Storyboard.TargetName=&quot;translate2&quot; <br>                                Storyboard.TargetProperty=&quot;X&quot;<br>                                Duration=&quot;0:0:5&quot; /&gt;<br>                        &lt;/Storyboard&gt;<br>                    &lt;/BeginStoryboard&gt;<br>                &lt;/EventTrigger&gt;<br>            &lt;/Label.Triggers&gt;Scrolling Text&lt;/Label&gt;<br>      &lt;/Border&gt;</p></div></div> <p> </p> <p></p> <p> </p>Sat, 21 Jul 2007 15:55:45 Z2007-07-26T03:12:23Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/0258951a-5e40-487a-a752-c8c30f1922d9#7fc174e4-d340-4fe4-bfcf-faebc3ae9d11http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/0258951a-5e40-487a-a752-c8c30f1922d9#7fc174e4-d340-4fe4-bfcf-faebc3ae9d11MattCheshirehttp://social.msdn.microsoft.com/Profile/en-US/?user=MattCheshireBasic WPF Animation Question<p>Matt,</p> <p><br>Thanks that resolves the over scrolling bit <img height=19 alt=Smile src="http://forums.microsoft.com/MSDN/emoticons/emotion-1.gif" width=19> One more problem, is that the &quot;Binding ElelmentName=border, Path=ActualWidth&quot; seem to be evaluating to zero (it just scroll left from its current position - same effect as hardcoding zero). </p> <p> </p><font color="#0000ff" size=1> <p>&lt;</font><font color="#a31515" size=1>DoubleAnimation</p></font><font color="#0000ff" size=1> <p></font><font color="#ff0000" size=1>From</font><font color="#0000ff" size=1>=</font><font size=1>&quot;</font><strong><font color="#0000ff" size=1>{Binding ElementName=border, Path=ActualWidth}</font><font size=1>&quot;</font><font color="#0000ff" size=1> </font></strong><font color="#ff0000" size=1>To</font><font color="#0000ff" size=1>=</font><font size=1>&quot;</font><font color="#0000ff" size=1>-300</font><font size=1>&quot;</p></font><font color="#0000ff" size=1> <p></font><font color="#ff0000" size=1>Storyboard.TargetName</font><font color="#0000ff" size=1>=</font><font size=1>&quot;</font><font color="#0000ff" size=1>translate2</font><font size=1>&quot;</p></font><font color="#0000ff" size=1> <p></font><font color="#ff0000" size=1>Storyboard.TargetProperty</font><font color="#0000ff" size=1>=</font><font size=1>&quot;</font><font color="#0000ff" size=1>X</font><font size=1>&quot;</p></font><font color="#0000ff" size=1> <p></font><font color="#ff0000" size=1>Duration</font><font color="#0000ff" size=1>=</font><font size=1>&quot;</font><font color="#0000ff" size=1>0:0:5</font><font size=1>&quot;</font><font color="#0000ff" size=1> /&gt;</p></font>Sat, 21 Jul 2007 16:01:48 Z2007-07-21T16:01:48Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/0258951a-5e40-487a-a752-c8c30f1922d9#955ba529-c5dc-4828-a47d-1560de4995cahttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/0258951a-5e40-487a-a752-c8c30f1922d9#955ba529-c5dc-4828-a47d-1560de4995caMatt Hohn - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Matt%20Hohn%20-%20MSFTBasic WPF Animation Questioni wasn't to sure what you wanted there and that will work if you have a width set on the border.  The idea had with that is that the starting point would be == border.actualwidth, essentially starting at the far right of the border.  That value should be what ever you want (From=&quot;200&quot; or something like that), i put the sample together pretty quick.  Sorry for any confusion.Sat, 21 Jul 2007 16:13:32 Z2007-07-21T16:13:32Z