title: C# draw a moving particle
body: <p>I am extremely new to c# and I have a simple question:
  I am supposed to draw a white particle (rectangle) on a black background and move it horizontally from one of the screen to another. 
  I did it but the problem is it blinks too much (i.e. it is not smooth even when the speed is high, I can easily see the black background between each move and another)</p>
  
  <pre><code>t.Interval = 1000 / speed;
  t.Tick += new EventHandler(t_Tick);
  t.Start();
  </code></pre>
  
  <p>....</p>
  
  <pre><code>void t_Tick(object sender, EventArgs e)
          {
              //g.Clear(Color.Black);
              g.DrawRectangle(new Pen(Brushes.Black, 20), r);      //draw a black rectangle in the old position...20 is the thickness of the pen
              r.X += move_x;
              g.DrawRectangle(new Pen(Brushes.White, 20), r);      //draw a white rectangle in the new position...20 is the thickness of the pen
              if (r.X &gt;= 1700)       ///this means it reached the end of the screen
                  t.Stop();
          }
  </code></pre>
  
  <p>I used g.Clear to clear the graphics but this also did not work, so I drew a black rectangle in the old position before moving it to the new position.</p>
  
  <p>Any Idea how to remove this blinking or even do it in another way?</p>