PaintValueEventArgs Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides data for the PaintValue(Object, Graphics, Rectangle) method.
public ref class PaintValueEventArgs : EventArgs
public class PaintValueEventArgs : EventArgs
type PaintValueEventArgs = class
inherit EventArgs
Public Class PaintValueEventArgs
Inherits EventArgs
- Inheritance
Examples
The following code example method returns a PaintValueEventArgs that provides the data needed to paint a representation of the value of an object within a given area:
PaintValueEventArgs^ CreatePaintValueEventArgs( System::ComponentModel::ITypeDescriptorContext^ context, Object^ value, Graphics^ graphics, Rectangle bounds )
{
PaintValueEventArgs^ e = gcnew 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;
}
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;
}
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
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.
Constructors
PaintValueEventArgs(ITypeDescriptorContext, Object, Graphics, Rectangle) |
Initializes a new instance of the PaintValueEventArgs class using the specified values. |
Properties
Bounds |
Gets the rectangle that indicates the area in which the painting should be done. |
Context |
Gets the ITypeDescriptorContext interface to be used to gain additional information about the context this value appears in. |
Graphics |
Gets the Graphics object with which painting should be done. |
Value |
Gets the value to paint. |
Methods
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
ToString() |
Returns a string that represents the current object. (Inherited from Object) |