Controls method:Invalidate(), Refresh() and Update()

  • Thread starter Thread starter Amy
  • Start date Start date
A

Amy

What's different between Controls method Refresh() and
Invalidate(), Refresh() and Update()?

Your help will be appreciated. Thanks.
 
Amy,
Control.Refresh - does an Control.Invalidate followed by Control.Update.

Control.Invalidate - invalidates a specific region of the Control (defaults
to
entire client area) and causes a paint message to be sent to the control.

Control.Update - causes the Paint event to occur immediately (Windows will
normally
wait until there are no other messages for the window to process, before
raising the Paint event).

The paint event of course is where all the drawing of your form occurs. Note
there is only one pending Paint event, if you call Invalidate 3 times, you
will still only receive one Paint event.

Hope this helps
Jay
 

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