Occurs when a form or toolbar is repainted.
PROCEDURE Object.Paint |
Remarks
A form or toolbar is repainted when part or all of the form or toolbar is exposed after it has been moved or sized, or after a window that was covering the form or toolbar has been moved.
Using a Refresh method in a Resize event forces repainting of the entire object every time a user resizes the form or toolbar.
The Paint event can be called frequently; therefore avoid performing data manipulation or calling commands or functions that set up a modal state.
Using a Paint event for certain tasks can cause a cascading event. In general, avoid using a Paint event for the following:
-
Moving or sizing a form or control.
-
Changing any variables that affect size or appearance, such as setting an object's BackColor property.
-
Calling the Refresh method.
Note: A Resize event may be more appropriate for some of these tasks.