Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drawing stops in PaintEvent

Status
Not open for further replies.

WhyYes

Programmer
Mar 5, 2008
1
CH
My drawing method (in principle without end) is working (at least starting) perfectly in a panel. However, whenever something 'happens' (say an email comes in, or i touch the screen somewhere (outside of the panel) drawing stops immediately and does not resume.

Any help appreciated

Erich, Switzerland
 
your drawing method never ends? Well that would probably be the root of the problem. Any time just about ANYTHING happens, windows will refire it. If its still running from the previous message, it will wait for it, therefore lock up.

You should try to keep the running time of your draw methods as short as possible to keep your app smooth and responsive. Any process that is "perpetual" should be in its own thread.
 
Can you post the contents of your Paint method?

A lot of users make the mistake of creating brushes and pens on every draw. This allocation takes unnecessary time.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top