views:

15

answers:

1

If I override a member (e.g AutoSize in the Button Class), then the intellisense no longer appears in the editor, forcing me to re-decorate the property.

Is there an option somewhere that I need to check?

ETA: Here's a code sample:

Public Class MyButton
    Inherits Button

    Public Overrides Property AutoSize() As Boolean
        Get
            Return MyBase.AutoSize
        End Get
        Set(ByVal value As Boolean)
            MyBase.AutoSize = value
        End Set
    End Property

End Class

If I then type:

Dim b as New MyButton
b.AutoSize ...

The intellisense explaining the AutoSize property doesn't appear.

A: 

Whether a property is visible in IntelliSense is controlled by the [EditorBrowsable] attribute. VB.NET is a bit special because it hides EditorBrowsableState.Advanced by default.

None of this would apply to an override to Button.AutoSize, it is always visible. Maybe you can give a better example, a code snippet is always good.

Hans Passant
Hi, I've added a code sample to clarify what's up.
Jules
I'm guessing you are talking about the comment "Gets or sets a value ...". Yes, that doesn't get 'inherited'. That wouldn't be appropriate, you overrode it with (normally) the specific intention to alter its behavior. Same in C#. You need to add XML documentation to fix that.
Hans Passant
Ah bugger. Cheers anyway.
Jules