title: How to implement smooth scrolling in .NET
body: <p>I want to implement a smooth/animated scrolling for a custom control in C#. I want something similar to the following javascript example:</p>
  
  <p><a href="http://www.kryogenix.org/code/browser/smoothscroll/#p0" rel="nofollow">http://www.kryogenix.org/code/browser/smoothscroll/#p0</a></p>
  
  <p>My first idea is moving the scrollbars to the target point but stopping in intermediate points. For example, this is a very simplified idea:</p>
  
  <pre><code>public void SetSrollValue(int x)
  {
      // assume right scrolling
      float step = x / 10;
  
      while (scroll.Value &lt; x)
      {
          scroll.Value += step;
      }
  }
  </code></pre>
  
  <p>My questions are:</p>
  
  <ul>
  <li>Should I implement this in a thread?</li>
  <li>Will this be painted smoothly (I suppose that yes if I have double buffer activated in my control)</li>
  </ul>
  
  <p>So, if you know any good example, article, guide or similar, please could you provider a link here?</p>
  
  <p>Thanks in advance.</p>