title: VB.NET text animation
body: <p>I am doing a scrolling text animation with VS2010 and Windows 7. I have a textbox, label and a button, of course a timer to make this work. following is the code I put in timer.</p>
  
  <pre><code>Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
      Label1.Text = TextBox1.Text
      Timer1.Interval = 1000
      Timer1.Start()
  
  End Sub
  
  Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
      'Dim txtBuffer As String = TextBox1.Text
      Label1.Text = Label1.Text
      If Len(Label1.Text) &lt;&gt; 0 Then
          Label1.Text = Microsoft.VisualBasic.Right(Label1.Text, (Len(Label1.Text) - 1))
      Else
          Timer1.Enabled = False
      End If
  End Sub
  </code></pre>
  
  <p>My problem is when you input a certain amount of space at the start of string, the scrolling animation is kind of strange. It will not showing the string moving from right side into the label, but only show the whole string at once then start scrolling out of the left boundary of the label. </p>
  
  <p>I am using fixed length of label, my purpose is to simulate a message board, so the text can be scrolled into the msg box from right side and moving out from left. </p>
  
  <p>I debuged each time the timer was triggered and the head of string which is a certain amount of spaces does go away one by one. But I didn't see the expected animation on the label. </p>
  
  <p>The size of label is 7 upper case letters' width and AutoSize property is false. If in the textbox you input is "[7 space] ABCDEFG", then you would expect the scrolling effect would be "[7 space]"->"[6 space]A"->"[5 space]AB"-> "[4 space]ABC"->...->"ABCDEFG"->"BCDEFG"->"CDEFG"->...->"". But you won't get it. All you will get is "[7 space]" for a while, then all of a sudden, "ABCDEFG" appears, then the letters go away one by one. The string is not looks like it slides in from the right side of label area.</p>
  
  <p>I don't know if anyone can help on that or maybe have a better idea to realize that animation? Thanks!</p>