Re: How can I make a property not show in the properties window?

From: Jay B. Harlow [MVP - Outlook] (Jay_Harlow_MVP_at_msn.com)
Date: 02/27/05


Date: Sun, 27 Feb 2005 11:30:38 -0600

Dennis,
If you want to "override" the *attributes* of a not overridable property.

You can Shadow the property.

>> <Browsable(False)> _
>> Public Shadows Property AutoScroll() As Boolean
>> Get
>> Return MyBase.AutoScroll
>> End Get
>> Set(ByVal Value As Boolean)
>> MyBase.AutoScroll = Value
>> End Set
>> End Property

Note: Shadowing a property to change the attributes is one of the few times
when you need to "design" with Shadows. Otherwise Shadows should be reserved
for version control...

However as Herfried suggests, Control.AutoScroll is overridable in VB.NET
2003.

Hope this helps
Jay

"Dennis" <Dennis@discussions.microsoft.com> wrote in message
news:857EB3D0-5085-4CA6-AE31-F1161A0D3C99@microsoft.com...
> AutoScroll cannot be overridden!
>
> "Herfried K. Wagner [MVP]" wrote:
>
>> " Just Me" <groups@a-znet.com> schrieb:
>> > Am I missing something?
>> > Where would I place <Browsable(False)>
>> > The AutoScroll property comes with the UserControl.
>> > I don't generate it.
>>
>> Untested:
>>
>> \\\
>> <Browsable(False)> _
>> Public Overrides Property AutoScroll() As Boolean
>> Get
>> Return MyBase.AutoScroll
>> End Get
>> Set(ByVal Value As Boolean)
>> MyBase.AutoScroll = Value
>> End Set
>> End Property
>> ///
>>
>> --
>> M S Herfried K. Wagner
>> M V P <URL:http://dotnet.mvps.org/>
>> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
>>



Relevant Pages

  • Re: Compiler confusion with using Shadows keyword
    ... I think Shadows was somehow meant to allow you to override what the designer ... I have no idea where Shadowing fits into the design anyway. ... > Public Class ShadowsMethod ...
    (microsoft.public.dotnet.languages.vb)
  • Re: overides/loads usage
    ... your derived member to override the base class member. ... difference bvetween Shadows and Overrides. ... Overridable Sub Step1 ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Interface suggestions
    ... the original & override the value. ... Public Shadows Property FlatStyle() As FlatStyle ... The reason we need the DefaultValue attribute on it to let the Designer know ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Arriving to max field size
    ... not convert boolean to string". ... > in the override KeyPress procedure. ... > DBGrid1: TDBGrid; ...
    (borland.public.delphi.database.ado)
  • Re: Overloads vs Shadows
    ... Item is not overridable, so I used Shadows, and it works as I want. ... MustOverride) seems to have lost some steam if I can effect an override on something that is not declared as overridable. ... Public Class Test1 ... Public Sub Show ...
    (microsoft.public.dotnet.languages.vb)