Specifing the Editor a PropertyGrid should use on a Custom Control Property

I've got a custom control that using a Padding value to determine the amount of space left around the text drawn to the control.  This "padding value" is identical in concept to the ScrollableControl.DockPaddingEdges object.

I was unable to inherit an actual DockPaddingEdges object so I wrote a class (called FieldPadding) that provides the same functionality.

What I don't know is the name of Editor Type to use in the Editor Attribute that would specify the DockPaddingEdges Editor.  I've looked at MSDN info on the Editor Attribute, and I see how it works for a Image editor, I just don't know what to specify for the specific editor I want to use...


Here's an example of a padding property (type FieldPadding) on a custom control that should use the DockPaddingEdges Editor in a PropertyGrid:


    <Browsable(True), Editor("WhatGoesHere ", GetType(System.Drawing.Design.UITypeEditor)), _
    Description("Sets additional space between the border and the text")> _
    Public Property BorderPadding() As FieldPadding
        Get
            Return myBorderPadding
        End Get
        Set(ByVal Value As FieldPadding)
            myBorderPadding = Value
        End Set
    End Property


Can anyone help


Answer this question

Specifing the Editor a PropertyGrid should use on a Custom Control Property

  • Larry OBrien

    I'm using .NET 1.1 and I've seen that the DockPadding property of ScrollableControl does not use a special UITypeEditor.  Instead, it just uses a custom TypeConverter which is responsible for displaying the said class properly on the PropertyGrid.  You might just want to look at the said classes using <a href="http://www.aisto.com/roeder/dotnet/">Reflector</a> for a better help than the documentation.
  • Specifing the Editor a PropertyGrid should use on a Custom Control Property