title: VB.NET How to clear the form's background
body: <p>I am trying to create a simply bouncy ball application in VB net;
  I am using a timer and the FillEllipse() method to try ad create a new circle at every tick of the timer.
  Code: </p>
  
  <pre><code>Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
          Dim Gr As Graphics = Me.CreateGraphics
  
          Gr.FillEllipse(Brushes.Teal, X, Y, W, H)
          CollisionDetect()
          X = X + X_Dir
          Y = Y + Y_Dir
  
          Gr.Dispose()
  
      End Sub
  </code></pre>
  
  <p>The result? The form continously draws onto itself, without clearing the last circle. This means that you end up with a 'line' of spheres together.</p>
  
  <p>To clarify: 
  X is well, the X-Coords
  Y is Y- Y-Coords</p>
  
  <p>X_Dir is an integer, it is added to every iteration of the loop so the next time the loop iterates, it'll be at a different location;
  Y_Dir is the same but for the Y Coords;</p>
  
  <p>CollisionDetect() Is empty. It is yet to be filled, it will handle the collision with the sides of the forms.
  W, H are width and height, respectively.</p>
  
  <p>Ideas?</p>