PropertyValueUIItem クラス

定義

関連付けられたイベント ハンドラー、ポップアップ情報文字列、プロパティに表示するアイコンなど、プロパティ ウィンドウに表示されるプロパティに関する情報を提供します。

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

次のコード例では、PropertyValueUIItem または HorizontalMargin という名前のコンポーネントのプロパティに対してVerticalMargin オブジェクトを提供します。 これらのプロパティの 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)

適用対象

こちらもご覧ください