Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft