2

We are using graphics context of a form to draw an image. However it works fine on initial paint but the image is not being updated unless we set a breakpoint and run it in debug mode, stepping through each time.

What is a good way of making a seperate thread to paint on to a form every second?

Thanks.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
flavour404
  • 6,184
  • 30
  • 105
  • 136

2 Answers2

2

You don't need a thread. Just call Invalidate() on your form when a meaningful change in status has occurred (or from a timer).

Also see How do I call paint event?

Community
  • 1
  • 1
H H
  • 263,252
  • 30
  • 330
  • 514
1

Not sure of your exact scenario but you may be after Application.DoEvents.

Justin
  • 4,434
  • 4
  • 28
  • 37