Control.Paint Event
.NET Framework (current version)
Occurs when the control is redrawn.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
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.
.NET Framework
Available since 1.1
Available since 1.1
Show: