Control.Paint Event

 

Occurs when the control is redrawn.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

member Paint : IEvent<PaintEventHandler,
    PaintEventArgs>

The Paint event is raised when the control is redrawn. It passes an instance of PaintEventArgs to the method(s) that handles the Paint event.

When creating a new custom control or an inherited control with a different visual appearance, you must provide code to render the control by overriding the OnPaint method. For more information, see Overriding the OnPaint Method and Custom Control Painting and Rendering.

For more information about handling events, see Handling and Raising Events.

The following code example creates a PictureBox control on the form and uses the Paint event to draw to it.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: