views:

16

answers:

2

I have a form where I have created a custom property, DataEntryRole, and set its Browsable attribute to True, as shown:

<Browsable(True)> _
Public Property DataEntryRole() As UserRole.PossibleRoles
    Get
        Return mDataEntryRole
    End Get
    Set(ByVal value As UserRole.PossibleRoles)
        mDataEntryRole = value
    End Set
End Property

(UserRole.PossibleRoles is an Enum)

When I view the designer for my form, DataEntryRole doesn't appear in the property box. I assume that it should appear if I were to create another form that inherited from this base form, but that's not what I want. I want this property to show up in my current form.

Is this possible? If so, how? If not, what in your opinion is a viable alternative?

A: 

I believe the reason why your custom property isn't showing up in the Properties window is because you are using a custom enumeration. If you use primitive types (int, bool, string, etc.), then they show up because they are easily editable from within the Properties window.

Bernard
I thought that too, but I tried setting the property and it's underlying member (mDataEntryRole) to String and the property still doesn't show up in the designer.
Ski
A: 

In the end, I made a subclass of Form and added the properties I wanted to that subclass. I then set my form to inherit from that subclass and the properties now display in the properties box. I'm still curious about whether there is a way to do what I asked without making a Form subclass.

Ski