PropertyValueUIItem(Image, PropertyValueUIItemInvokeHandler, String) 생성자

정의

PropertyValueUIItem 클래스의 새 인스턴스를 초기화합니다.

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)

매개 변수

uiItemImage
Image

표시할 아이콘입니다. 이미지는 8 x 8 픽셀이어야 합니다.

handler
PropertyValueUIItemInvokeHandler

이미지를 두 번 클릭할 때 호출할 처리기입니다.

tooltip
String

ToolTip 연결된 속성 PropertyValueUIItem 에 대해 표시할 값입니다.

예외

uiItemImage 또는 handler .입니다 null.

예제

다음 코드 예제에서는 이름 또는 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"));
    }
}

적용 대상

추가 정보