Partager via


Paint Event

Occurs when a form or toolbar is repainted.

PROCEDURE Object.Paint

Remarks

Applies To: Form | ToolBar

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.

See Also

Reference

Circle Method

ClipControls Property

Line Method

Print Method

PSet Method

Refresh Method (Visual FoxPro)

Resize Event

Other Resources

Properties (Visual FoxPro)