PropertyValueUIItem 类  
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供在“属性”窗口中显示的属性信息,包括关联的事件处理程序、弹出信息字符串以及要为属性显示的图标。
public ref class PropertyValueUIItempublic class PropertyValueUIItemtype PropertyValueUIItem = classPublic Class PropertyValueUIItem- 继承
- 
				PropertyValueUIItem
示例
下面的代码示例为名为 HorizontalMargin 或 VerticalMargin的组件的任何属性提供PropertyValueUIItem对象。 
              PropertyValueUIItem这些属性的 提供图像、工具提示和事件处理程序,在单击属性的图像时显示消息框。 此代码示例是为 接口提供的更大示例的 IPropertyValueUIService 一部分。
// PropertyValueUIHandler delegate that provides PropertyValueUIItem
// objects to any properties named HorizontalMargin or VerticalMargin.
private void marginPropertyValueUIHandler(
    System.ComponentModel.ITypeDescriptorContext context,
    System.ComponentModel.PropertyDescriptor propDesc,
    ArrayList itemList)
{
    // A PropertyValueUIHandler added to the IPropertyValueUIService
    // is queried once for each property of a component and passed
    // a PropertyDescriptor that represents the characteristics of 
    // the property when the Properties window is set to a new 
    // component. A PropertyValueUIHandler can determine whether 
    // to add a PropertyValueUIItem for the object to its ValueUIItem 
    // list depending on the values of the PropertyDescriptor.
    if (propDesc.DisplayName.Equals("HorizontalMargin"))
    {
        Image img = Image.FromFile("SampImag.jpg");
        itemList.Add(new PropertyValueUIItem(img, new PropertyValueUIItemInvokeHandler(this.marginInvoke), "Test ToolTip"));
    }
    if (propDesc.DisplayName.Equals("VerticalMargin"))
    {
        Image img = Image.FromFile("SampImag.jpg");
        img.RotateFlip(RotateFlipType.Rotate90FlipNone);
        itemList.Add(new PropertyValueUIItem(img, new PropertyValueUIItemInvokeHandler(this.marginInvoke), "Test ToolTip"));
    }
}
构造函数
| PropertyValueUIItem(Image, PropertyValueUIItemInvokeHandler, String) | 初始化 PropertyValueUIItem 类的新实例。 | 
属性
| Image | 获取将绘制在“属性”窗口中的 8 x 8 像素图像。 | 
| InvokeHandler | 获取当用户双击此项时引发的处理程序。 | 
| ToolTip | 获取或设置为此项显示的信息字符串。 | 
方法
| Equals(Object) | 确定指定对象是否等于当前对象。(继承自 Object) | 
| GetHashCode() | 作为默认哈希函数。(继承自 Object) | 
| GetType() | 获取当前实例的 Type。(继承自 Object) | 
| MemberwiseClone() | 创建当前 Object 的浅表副本。(继承自 Object) | 
| Reset() | 重置用户界面 (UI) 项。 | 
| ToString() | 返回表示当前对象的字符串。(继承自 Object) |