Re: Inherit a class but not all its properties

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Henri (hmfireball_at_hotmail.com)
Date: 11/26/04


Date: Fri, 26 Nov 2004 11:13:18 +0100

Thanks for your explanation Carlos :-) !
So the property was only non browsable.

Thanks again.
Henri

"Carlos J. Quintero [MVP]" <carlosq@NOSPAMsogecable.com> a écrit dans le
message de news:u65hcm50EHA.3096@TK2MSFTNGP10.phx.gbl...
> Where have you seen that it is not present anymore? You can type:
>
> Dim e1 As DataGridItemEventArgs
> Dim e2 As DataGridItemEventArgs
>
> e2 = e1.Empty
>
>
> And this compiles fine, as expected, because a derived class can not
exclude
> properties of its base class. At most, it can make them non browsable
using
> the System.Component.BrowsableAttribute attribute
>
> --
>
> Carlos J. Quintero
>
> The MZ-Tools all-in-one add-in, now for .NET: http://www.mztools.com
>
> "Henri" <hmfireball@hotmail.com> escribió en el mensaje
> news:eL7rES10EHA.3896@TK2MSFTNGP09.phx.gbl...
> > For instance, consider System.EventArgs :
> > it has a public shared property called Empty
> >
> > Now if you look at System.Web.UI.WebControls.DataGridItemEventArgs, that
> > inherits System.EventArgs,
> > Empty is not present anymore
> > My question is :
> > how it is possible to do the same in VB.NET, that is, inheriting a class
> > but
> > not, among its properties, the ones that are useless in the child class?
> > I thought this could be done using Private Shadows, but it seems that
it's
> > the base class' property that is accessed then.
>
>
>
>



Relevant Pages