Method CreateDrawingContext
CreateDrawingContext()
Creates the Graphics for the control.
public virtual Graphics CreateDrawingContext()
Returns
Remarks
The Graphics object that you retrieve through the CreateDrawingContext() method should not normally be retained after the current UI event has been processed, because anything painted with that object will be erased with the next paint event. Therefore you cannot cache the Graphics object for reuse, except to use non-visual methods like MeasureText(string, Font). Instead, you must call CreateDrawingContext() every time that you want to use the Graphics object, and then call its Dispose() when you are finished using it.