UITypeEditor Class

 

Provides a base class that can be used to design value editors that can provide a user interface (UI) for representing and editing the values of objects of the supported data types.

Namespace:   System.Drawing.Design
Assembly:  System.Drawing (in System.Drawing.dll)

System.Object
  System.Drawing.Design.UITypeEditor
    System.ComponentModel.Design.BinaryEditor
    System.ComponentModel.Design.CollectionEditor
    System.ComponentModel.Design.DateTimeEditor
    System.ComponentModel.Design.MultilineStringEditor
    System.ComponentModel.Design.ObjectSelectorEditor
    System.Drawing.Design.ColorEditor
    System.Drawing.Design.ContentAlignmentEditor
    System.Drawing.Design.CursorEditor
    System.Drawing.Design.FontEditor
    System.Drawing.Design.FontNameEditor
    System.Drawing.Design.IconEditor
    System.Drawing.Design.ImageEditor
    System.Messaging.Design.QueuePathEditor
    System.Web.UI.Design.ConnectionStringEditor
    System.Web.UI.Design.DataBindingCollectionEditor
    System.Web.UI.Design.ExpressionsCollectionEditor
    System.Web.UI.Design.UrlEditor
    System.Web.UI.Design.WebControls.DataControlFieldTypeEditor
    System.Web.UI.Design.WebControls.DataGridColumnCollectionEditor
    System.Web.UI.Design.WebControls.DataPagerFieldTypeEditor
    System.Web.UI.Design.WebControls.MenuBindingsEditor
    System.Web.UI.Design.WebControls.MenuItemCollectionEditor
    System.Web.UI.Design.WebControls.ParameterCollectionEditor
    System.Web.UI.Design.WebControls.RegexTypeEditor
    System.Web.UI.Design.WebControls.TreeNodeCollectionEditor
    System.Web.UI.Design.WebControls.TreeViewBindingsEditor
    System.Web.UI.Design.XmlFileEditor
    System.Windows.Forms.Design.AnchorEditor
    System.Windows.Forms.Design.BorderSidesEditor
    System.Windows.Forms.Design.DockEditor
    System.Windows.Forms.Design.FileNameEditor
    System.Windows.Forms.Design.FolderNameEditor
    System.Windows.Forms.Design.ShortcutKeysEditor
    System.Workflow.ComponentModel.Design.BindUITypeEditor
    System.Workflow.ComponentModel.Design.TypeBrowserEditor

[<PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")>]
[<PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")>]
type UITypeEditor = class end

NameDescription
System_CAPS_pubmethodUITypeEditor()

Initializes a new instance of the UITypeEditor class.

NameDescription
System_CAPS_pubpropertyIsDropDownResizable

Gets a value indicating whether drop-down editors should be resizable by the user.

NameDescription
System_CAPS_pubmethodEditValue(IServiceProvider, Object)

Edits the value of the specified object using the editor style indicated by the GetEditStyle method.

System_CAPS_pubmethodEditValue(ITypeDescriptorContext, IServiceProvider, Object)

Edits the specified object's value using the editor style indicated by the GetEditStyle method.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetEditStyle()

Gets the editor style used by the EditValue method.

System_CAPS_pubmethodGetEditStyle(ITypeDescriptorContext)

Gets the editor style used by the EditValue method.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetPaintValueSupported()

Indicates whether this editor supports painting a representation of an object's value.

System_CAPS_pubmethodGetPaintValueSupported(ITypeDescriptorContext)

Indicates whether the specified context supports painting a representation of an object's value within the specified context.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodPaintValue(Object, Graphics, Rectangle)

Paints a representation of the value of the specified object to the specified canvas.

System_CAPS_pubmethodPaintValue(PaintValueEventArgs)

Paints a representation of the value of an object using the specified PaintValueEventArgs.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

The UITypeEditor class provides a base class that you can derive from and extend to implement a custom type editor for the design-time environment. Typically, your custom type editor interacts with the PropertyGrid control.

Custom type editors are useful in situations where a text-box value editor is insufficient to effectively select the values of certain types.

To implement a custom design-time UI type editor, you must perform the following steps:

  • Define a class that derives from UITypeEditor.

  • Override the EditValue method to handle the user interface, user input processing, and value assignment.

  • Override the GetEditStyle method to inform the Properties window of the type of editor style that the editor will use.

You can add additional support for painting a value's representation in the Properties window by performing the following steps:

  • Override the GetPaintValueSupported method to indicate that the editor supports displaying the value's representation.

  • Override the PaintValue method to implement the display of the value's representation.

  • Override the UITypeEditor constructor method if the editor should have initialization behavior.

System_CAPS_noteNote

The UITypeEditor class does not support right-to-left (RTL) layouts.

For more information about enhancing design-time support, see Extending Design-Time Support. For more information on implementing a UITypeEditor, see User Interface Type Editors Overview.

The following code example demonstrates that a UITypeEditor can be associated with an integer, double, or float property using an EditorAttribute to provide an angle selection interface from the Properties window in design mode. This example uses the IWindowsFormsEditorService interface to display a drop-down control in the Properties window in design mode. Compile the code and add the assembly to the Toolbox using the Customize Toolbox command on the Tools menu of Visual Studio. Create an instance of the AngleTestControl and click the drop-down button next to the Angle property in the Properties window to configure the property using the editor.

No code example is currently available or this language may not be supported.

NamedPermissionSet

for full access to system resources. Demand values: LinkDemand, InheritanceDemand. Associated state:

.NET Framework
Available since 1.1

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: