Provides data for the Paint event.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Initializes a new instance of theclass with the specified graphics and clipping rectangle.
Releases all resources used by the.
Releases the unmanaged resources used by theand optionally releases the managed resources.
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Overrides Object.Finalize().)
Serves as the default hash function. (Inherited from Object.)
Returns a string that represents the current object.(Inherited from Object.)
The following example demonstrates handling the Paint event and using the 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.