By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,286 Members | 2,422 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,286 IT Pros & Developers. It's quick & easy.

Control.InValidate vs. Control.Refresh()?

P: n/a
What's the difference between calling the first and the second (see
subject).

Thanks!

/Claus
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Claus Konrad wrote:

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?
Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.