This topic has not yet been rated - Rate this topic

PropertyValueUIItem Class

Provides information about a property displayed in the Properties window, including the associated event handler, pop-up information string, and the icon to display for the property.

System.Object
  System.Drawing.Design.PropertyValueUIItem

Namespace:  System.Drawing.Design
Assembly:  System.Drawing (in System.Drawing.dll)
[PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")]
[PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
public class PropertyValueUIItem

The PropertyValueUIItem type exposes the following members.

  NameDescription
Public methodPropertyValueUIItemInitializes a new instance of the PropertyValueUIItem class.
Top
  NameDescription
Public propertyImageGets the 8 x 8 pixel image that will be drawn in the Properties window.
Public propertyInvokeHandlerGets the handler that is raised when a user double-clicks this item.
Public propertyToolTipGets or sets the information string to display for this item.
Top
  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodResetResets the user interface (UI) item.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The following code example provides a PropertyValueUIItem object for any properties of the component named HorizontalMargin or VerticalMargin. The PropertyValueUIItem for these properties provides an image, a ToolTip, and an event handler that displays a message box when the image for the property is clicked. This code example is part of a larger example provided for the IPropertyValueUIService interface.

// 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 = DeserializeFromBase64Text(imageBlob1);
        itemList.Add( new PropertyValueUIItem( img, new PropertyValueUIItemInvokeHandler(this.marginInvoke), "Test ToolTip") );
    }
    if( propDesc.DisplayName.Equals( "VerticalMargin" ) )
    {
        Image img = DeserializeFromBase64Text(imageBlob1);
        img.RotateFlip(RotateFlipType.Rotate90FlipNone);
        itemList.Add( new PropertyValueUIItem( img, new PropertyValueUIItemInvokeHandler(this.marginInvoke), "Test ToolTip") );
    }
}

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.