Control.InValidate vs. Control.Refresh()?

  • Thread starter Thread starter Claus Konrad
  • Start date Start date
C

Claus Konrad

What's the difference between calling the first and the second (see
subject).

Thanks!

/Claus
 
Claus said:
What's the difference between calling the first and the second (see
subject).

Thanks!

/Claus

Invalidate marks the control (region, or rect) as in need of repainting, but
doesn't immediately repaint (the repaint is triggered when everything else has
been taken care of and the app becomes idle).

Update causes the control to immediately repaint if any portions have been
invalidated.

Refresh causes the control to invalidate, and then update (i.e. immediately
repaint itself).

Most of the time Invalidate is sufficient, and advisable as you can do a bunch
of invalidations (either explicit or implicit) and then let the control repaint
itself when the app is idle. It is advisable to use Update or Refresh when you
want the control to immediately repaint because the app will not be idle for a
user-noticable period of time.

Dig?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top