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.
Assembly: System.Drawing (in System.Drawing.dll)
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
| Name | Description | |
|---|---|---|
![]() | UITypeEditor() | Initializes a new instance of the UITypeEditor class. |
| Name | Description | |
|---|---|---|
![]() | IsDropDownResizable | Gets a value indicating whether drop-down editors should be resizable by the user. |
| Name | Description | |
|---|---|---|
![]() | EditValue(IServiceProvider, Object) | Edits the value of the specified object using the editor style indicated by the GetEditStyle method. |
![]() | EditValue(ITypeDescriptorContext, IServiceProvider, Object) | Edits the specified object's value using the editor style indicated by the GetEditStyle method. |
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() | GetEditStyle() | Gets the editor style used by the EditValue method. |
![]() | GetEditStyle(ITypeDescriptorContext) | Gets the editor style used by the EditValue method. |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetPaintValueSupported() | Indicates whether this editor supports painting a representation of an object's value. |
![]() | GetPaintValueSupported(ITypeDescriptorContext) | Indicates whether the specified context supports painting a representation of an object's value within the specified context. |
![]() | GetType() | |
![]() | MemberwiseClone() | |
![]() | PaintValue(Object, Graphics, Rectangle) | Paints a representation of the value of the specified object to the specified canvas. |
![]() | PaintValue(PaintValueEventArgs) | Paints a representation of the value of an object using the specified PaintValueEventArgs. |
![]() | ToString() | 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.
Note |
|---|
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.
for full access to system resources. Demand values: LinkDemand, InheritanceDemand. Associated state:
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.



