Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Specifing the Editor a PropertyGrid should use on a Custom Control Property
 

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???
MigrationUser 1  Monday, February 21, 2005 5:42 PM
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.
MigrationUser 1  Monday, February 21, 2005 8:18 PM

You can use google to search for other answers

Custom Search

More Threads

• concetenate control in winform
• Where are DialogKeys processed in Designer?
• 'Resources.Resources' error unable to open form in designer mode
• Using DesignSurface with licensed components
• Problems with TypeConverter when using arrays
• Split Container
• Should the order controls are added matter?
• How to make a copy of a Form?
• PictureBox - Transparent - Expected behaviour?
• XP Style Controls