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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference Between Invalidate() and Refresh()

Status
Not open for further replies.

BoulderBum

Programmer
Jul 11, 2002
2,179
US
What is the difference between Invalidate() and Refresh() in Windows programming?
 
I see the following differences:
- Refresh() forces a control to call invalidate() to itself immediately
(its client area) and also the child controls.
- The Invalidate() causes a paint message to be send to the control.
Example: In a form a picture is added in a client area at run time depending on where the mouse points.
To force the form to be redrawn with the image a call of thisForm.Invalidate() is mandatory;
- The Refresh() could be overriden but no Invalidate().
-obislavu-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top