Name

PaintEventArgs

Synopsis

This class encapsulates the data used by the Control.Paint event, raised when the Control needs repainting.

You can retrieve the System.Drawing.Graphics surface on which to draw and the ClipRectangle that needs repainting (to optimize your paint function).

Information about repaint is also included under Control and ControlStyles.


public class PaintEventArgs : EventArgs : IDisposable {

// Public Constructors

   public PaintEventArgs(System.Drawing.Graphics graphics, System.Drawing.Rectangle clipRect);

// Public Instance Properties

   public Rectangle ClipRectangle{get; }

   public Graphics Graphics{get; }

// Public Instance Methods

   public void Dispose();  // implements IDisposable

                  // Protected Instance Methods

   protected virtual void Dispose(bool disposing);

   protected override void Finalize();  // overrides object

}

Hierarchy

System.Object System.EventArgs PaintEventArgs(System.IDisposable)

Passed To

Control.{InvokePaint(), InvokePaintBackground(), OnPaintBackground(), RaisePaintEvent()}, System.Windows.Forms.Design.ComponentTray.OnPaint(), System.Windows.Forms.Design.ControlDesigner.OnPaintAdornments(), PaintEventHandler.{BeginInvoke(), Invoke()}

Get .NET Windows Forms in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.