Export (0) Print
Expand All

PaintValueEventArgs Class

Provides data for the PaintValue event.

For a list of all members of this type, see PaintValueEventArgs Members.

System.Object
   System.EventArgs
      System.Drawing.Design.PaintValueEventArgs

[Visual Basic]
Public Class PaintValueEventArgs
   Inherits EventArgs
[C#]
public class PaintValueEventArgs : EventArgs
[C++]
public __gc class PaintValueEventArgs : public EventArgs
[JScript]
public class PaintValueEventArgs extends EventArgs

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

PaintValueEventArgs provides all the information needed for a UITypeEditor to paint within an area based on the value of the specified object, including the Rectangle in which the drawing should be done and the Graphics object with which the drawing should be done.

Example

[Visual Basic, C#, C++] The following example method returns a PaintValueEventArgs that provides the data needed to paint a representation of the value of an object within a given area:

[Visual Basic] 
Public Function CreatePaintValueEventArgs(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal value As Object, ByVal graphics As Graphics, ByVal bounds As Rectangle) As PaintValueEventArgs
    Dim e As New PaintValueEventArgs(context, value, graphics, bounds)
    ' The context of the paint value event         e.Context
    ' The object representing the value to paint   e.Value
    ' The graphics to use to paint                 e.Graphics
    ' The rectangle in which to paint              e.Bounds                       
    Return e
End Function


[C#] 
public PaintValueEventArgs CreatePaintValueEventArgs(System.ComponentModel.ITypeDescriptorContext context, object value, Graphics graphics, Rectangle bounds)
{
    PaintValueEventArgs e = new PaintValueEventArgs(context, value, graphics, bounds);
    // The context of the paint value event         e.Context
    // The object representing the value to paint   e.Value
    // The graphics to use to paint                 e.Graphics
    // The rectangle in which to paint              e.Bounds                       
    return e;
}

[C++] 
public:
   PaintValueEventArgs* CreatePaintValueEventArgs(
      System::ComponentModel::ITypeDescriptorContext* context,
      Object* value,
      Graphics* graphics,
      Rectangle bounds)
   {
      PaintValueEventArgs* e = new PaintValueEventArgs(context, value, graphics, bounds);
      // The context of the paint value event         e.Context
      // The Object representing the value to paint   e.Value
      // The graphics to use to paint                 e.Graphics
      // The rectangle in which to paint              e.Bounds
      return e;
   }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: System.Drawing.Design

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System.Drawing (in System.Drawing.dll)

See Also

PaintValueEventArgs Members | System.Drawing.Design Namespace

Show:
© 2014 Microsoft