Control. Refresh-does an control. invalidate followed by control. Update.
Refresh: forces the control to invalidate its Workspace and immediately redraws itself and any child control. = Invalidate + 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. 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 ).
Invalidate: invalidates a specific region of the control (you can set the region by yourself to improve performance) and sends a draw message to the control.
Mark the control as re-painted, but do not immediately refresh and re-paint when the system is idle.
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 ). update causes the control to immediately repaint if any portions have been invalidated.
Update: Re-paint the invalid area in the workspace of the control and call the paint event immediately. If an invalid region exists, update will immediately trigger re-painting.
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.
Paint: ubiquitous. If you call invalidate three times, the system will trigger only one painting event.
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.
Most of the time, invalidate is enough. We recommend that you use invalidate when the system needs to refresh a large amount of data in a centralized manner, because the system will only refresh once, improving the system performance. We recommend that you use the refresh method if you want to perform the refresh operation immediately.