PaintValueEventArgs 类

定义

PaintValue(Object, Graphics, Rectangle) 方法提供数据。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
继承
PaintValueEventArgs

示例

下面的代码示例方法返回PaintValueEventArgs , 它提供了在给定区域内绘制对象值的表示形式所需的数据: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

注解

PaintValueEventArgs提供UITypeEditor要在基于指定对象的值的区域内进行绘制所需的所有信息, Rectangle包括Graphics应在其中完成绘制的, 以及应在其中完成绘制的对象。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.

构造函数

PaintValueEventArgs(ITypeDescriptorContext, Object, Graphics, Rectangle)

使用指定的值初始化 PaintValueEventArgs 类的新实例。Initializes a new instance of the PaintValueEventArgs class using the specified values.

属性

Bounds

获取矩形,该矩形指示应在其中完成绘制的区域。Gets the rectangle that indicates the area in which the painting should be done.

Context

获取 ITypeDescriptorContext 界面,该界面用于获取有关在其中出现此值的上下文的附加信息。Gets the ITypeDescriptorContext interface to be used to gain additional information about the context this value appears in.

Graphics

获取 Graphics 对象,使用该对象应完成绘制。Gets the Graphics object with which painting should be done.

Value

获取要绘制的值。Gets the value to paint.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

安全性

NamedPermissionSet
用于完全访问系统资源。for full access to system resources. 需求值: LinkDemandInheritanceDemandDemand values: LinkDemand, InheritanceDemand. 关联状态:Associated state:

适用于