PaintEventArgs Class
Provides data for the Paint event.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
System.EventArgs
System.Windows.Forms.PaintEventArgs
System.Windows.Forms.TableLayoutCellPaintEventArgs
| Name | Description | |
|---|---|---|
![]() | PaintEventArgs(Graphics, Rectangle) | Initializes a new instance of the PaintEventArgs class with the specified graphics and clipping rectangle. |
| Name | Description | |
|---|---|---|
![]() | ClipRectangle | Gets the rectangle in which to paint. |
![]() | Graphics | Gets the graphics used to paint. |
| Name | Description | |
|---|---|---|
![]() | Dispose() | Releases all resources used by the PaintEventArgs. |
![]() | Dispose(Boolean) | Releases the unmanaged resources used by the PaintEventArgs and optionally releases the managed resources. |
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Overrides Object.Finalize().) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | MemberwiseClone() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
The Paint event occurs when a control is redrawn. A PaintEventArgs specifies the Graphics to use to paint the control and the ClipRectangle in which to paint.
For information about the event model, see Handling and Raising Events.
The following example demonstrates handling the Paint event and using the PaintEventArgs class to draw rectangles on the form. The MouseDown and MouseUp events are handled to determine the size of the rectangle. The example also demonstrates the Invalidate method to invalidate the area of the rectangle, causing it to be redrawn.
Available since 1.1
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


