PropertyValueUIItem 類別

定義

提供 [屬性] 視窗中所顯示屬性的相關資訊,其中包括關聯的事件處理常式、快顯資訊字串和所要顯示的屬性圖示。

public ref class PropertyValueUIItem
public class PropertyValueUIItem
type PropertyValueUIItem = class
Public Class PropertyValueUIItem
繼承
PropertyValueUIItem

範例

下列程式碼範例會針對名為 HorizontalMarginVerticalMargin 之元件的任何屬性提供 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)

適用於

另請參閱