|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Can not create 2 properties with same signature.Why can't we create 2 properties with the same signature .. one on a base
class and one on a derived class, even though both properties are shared? Public Shared ReadOnly Property MyProperty() As Integer Thanks, Mythran Hello Mythran,
> Why can't we create 2 properties with the same signature .. one on a It is legal to do this. Add the Shadows keyword to the definition to explicitly > base class and one on a derived class, even though both properties are > shared? > > Public Shared ReadOnly Property MyProperty() As Integer state you want this behavior. Public Shared Shadows ReadOnly Property MyProperty() As Integer -- Jared Parsons [MSFT] jared***@online.microsoft.com All opinions are my own. All content is provided "AS IS" with no warranties, and confers no rights. "Mythran" <kip_potter@hotmail.comREMOVETRAIL> schrieb: Shared members are not overridable (virtual in C{#, ++} terms), thus this is > Why can't we create 2 properties with the same signature .. one on a base > class and one on a derived class, even though both properties are shared? > > Public Shared ReadOnly Property MyProperty() As Integer not possible. In other words it's not possible (except by using 'Shadows', but I think this is not a good solution) to change the behavior of a shared member in a derived class. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> |
|||||||||||||||||||||||