Aracılığıyla paylaş


PropertyValueUIItem(Image, PropertyValueUIItemInvokeHandler, String) Oluşturucu

Tanım

PropertyValueUIItem sınıfının yeni bir örneğini başlatır.

public:
 PropertyValueUIItem(System::Drawing::Image ^ uiItemImage, System::Drawing::Design::PropertyValueUIItemInvokeHandler ^ handler, System::String ^ tooltip);
public PropertyValueUIItem (System.Drawing.Image uiItemImage, System.Drawing.Design.PropertyValueUIItemInvokeHandler handler, string tooltip);
public PropertyValueUIItem (System.Drawing.Image uiItemImage, System.Drawing.Design.PropertyValueUIItemInvokeHandler handler, string? tooltip);
new System.Drawing.Design.PropertyValueUIItem : System.Drawing.Image * System.Drawing.Design.PropertyValueUIItemInvokeHandler * string -> System.Drawing.Design.PropertyValueUIItem
Public Sub New (uiItemImage As Image, handler As PropertyValueUIItemInvokeHandler, tooltip As String)

Parametreler

uiItemImage
Image

Görüntülenecek simge. Görüntü 8 x 8 piksel olmalıdır.

handler
PropertyValueUIItemInvokeHandler

Görüntüye çift tıklandığında çağrılacak işleyici.

tooltip
String

ToolTip Bu PropertyValueUIItem özelliğin görüntüleneceği yer.

Özel durumlar

uiItemImage veya handler şeklindedir null.

Örnekler

Aşağıdaki kod örneği, veya VerticalMarginadlı HorizontalMargin bileşenin tüm özellikleri için bir PropertyValueUIItem nesnesi sağlar. PropertyValueUIItem Bu özellikler için özelliğin görüntüsüne tıklandığında bir ileti kutusu görüntüleyen bir görüntü, Araç İpucu ve olay işleyicisi sağlar. Bu kod örneği, arabirim için IPropertyValueUIService sağlanan daha büyük bir örneğin parçasıdır.

// 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"));
    }
}

Şunlara uygulanır

Ayrıca bkz.