ToolboxItemAttribute 类  
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示工具箱项的特性。
public ref class ToolboxItemAttribute : Attribute[System.AttributeUsage(System.AttributeTargets.All)]
public class ToolboxItemAttribute : Attribute[<System.AttributeUsage(System.AttributeTargets.All)>]
type ToolboxItemAttribute = class
    inherit AttributePublic Class ToolboxItemAttribute
Inherits Attribute- 继承
- 属性
示例
下面的代码示例演示如何将 ToolboxItemAttribute 与 类一起使用 ToolboxItem 作为自定义工具箱项实现的基类。 此代码示例是为 ToolboxItem 类提供的一个更大示例的一部分。
[ToolboxItem(typeof(MyToolboxItem))]
public class UserControl1 : UserControl
<ToolboxItem(GetType(MyToolboxItem))> _
Public Class UserControl1
    Inherits UserControl
注解
类 ToolboxItemAttribute 提供了一种为 ToolboxItem指定特性的方法。 除了 类提供的内容 Attribute 外,此类对象还存储工具箱项的类型。
构造函数
| ToolboxItemAttribute(Boolean) | 初始化 ToolboxItemAttribute 类的新实例,并指定是否使用默认初始化值。 | 
| ToolboxItemAttribute(String) | 使用指定的类型名称初始化 ToolboxItemAttribute 类的新实例。 | 
| ToolboxItemAttribute(Type) | 使用工具箱项的指定类型初始化 ToolboxItemAttribute 类的新实例。 | 
字段
| Default | 初始化 ToolboxItemAttribute 类的新实例并将类型设置为默认值 ToolboxItem。 此字段为只读。 | 
| None | 初始化 ToolboxItemAttribute 类的新实例并将类型设置为  | 
属性
| ToolboxItemType | 获取或设置工具箱项的类型。 | 
| ToolboxItemTypeName | 获取或设置当前 ToolboxItem 的类型名称。 | 
| TypeId | 在派生类中实现时,获取此 Attribute 的唯一标识符。(继承自 Attribute) | 
方法
| Equals(Object) | 返回一个值,该值指示此实例是否与指定的对象相等。 | 
| GetHashCode() | 返回此实例的哈希代码。 | 
| GetType() | 获取当前实例的 Type。(继承自 Object) | 
| IsDefaultAttribute() | 获取一个值,该值指示该特性的当前值是否为该特性的默认值。 | 
| Match(Object) | 当在派生类中重写时,返回一个指示此实例是否等于指定对象的值。(继承自 Attribute) | 
| MemberwiseClone() | 创建当前 Object 的浅表副本。(继承自 Object) | 
| ToString() | 返回表示当前对象的字符串。(继承自 Object) | 
显式接口实现
| _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) | 将一组名称映射为对应的一组调度标识符。(继承自 Attribute) | 
| _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) | 检索对象的类型信息,然后可以使用该信息获取接口的类型信息。(继承自 Attribute) | 
| _Attribute.GetTypeInfoCount(UInt32) | 检索对象提供的类型信息接口的数量(0 或 1)。(继承自 Attribute) | 
| _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) | 提供对某一对象公开的属性和方法的访问。(继承自 Attribute) |