title: Invalidate without OnPaint
body: <p>I'm trying to make an animation in Win Forms, and I have tried a different approach than calling Invalidate() in the timer_elapsed handler and then doing things in the OnPaintHandler. </p>
  
  <p>I just directly draw an image on a pictureBox, then when the timer_ticks, I call Invalidate, and then I manually redraw the image on updated position.</p>
  
  <pre><code>static void tmrMoving_Elapsed(object sender, EventArgs e, Train t)
  {
      MainForm.playBox.Invalidate();
  
      g.DrawImage(t.components[i], new Rectangle(
                  new Point(t.nextVagoonPositionX * 20, t.nextVagoonPositionY * 20), 
                  new Size(20, 20)));
      t.nextVagoonPositionX += 1;
      t.nextPositionX = -1;
  }
  </code></pre>
  
  <p>I have a problem, that when the timer ticks, the desired image sometimes get drawn, and sometimes not, like 30% chance to not draw(I have 1sec timer intervals so I can see it), even if the object is moving or just being in the same location.</p>
  
  <p>Things I have tried: </p>
  
  <p>1.Setting a region in Invalidate() args -> the image got drawn many times next to the older images (So it wasn't repaint at the desired location as the old images remained in their locations)</p>
  
  <p>2.Calling Update() or Refresh() or both after the invalidate-> No image was ever shown</p>
  
  <p>3.Combining Update() or Refresh() or both with Invalidate(rectangulous region) -> no image ever shown</p>
  
  <p>4.Setting DoubleBuffering true -> no effect</p>
  
  <p>5.Fiddling with this.SetStyle(ControlStyles.UserPaint, true); -> no effect (not even sure what it does btw.)</p>