473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Hiding Properties of Inheirited Classes

I have a class named myclass that inheirits from "baseclass". There is a
property of "baseclass" that I don't want exposed in the IDE. The MSDN
documentation says"

"A derived type can hide an inherited member by defining a new member with
the same signature. This might be done to make a previously public member
private or to define new behavior for an inherited method that is marked as
final. "

However, this does not hide the property. For example, in my code;

dim c as myclass = new myclass

when I type c. the designer shows all the properties and methods and it
includes the property that I have made private in myclass.

Is there anyway that I can fix this?

--
Dennis in Houston
Nov 21 '05 #1
7 5145
Dennis,

You see that with the picturebox as well where in my opinion the
backgroundcolor is shadowed (hidden). When you shadows it and make it
private as the documentation says, than is my expirience that it takes the
property from the base class.

I have searched on Google for that and the only thing I found was setting
<browsable> to false, however that does not work as well in the IDE itself.

This does not help you hoever shows that you are not the only one who is
looking for a way to do this.

I hope that it helps in that way?

Cor

"Dennis" <De****@discussions.microsoft.com>
..
I have a class named myclass that inheirits from "baseclass". There is a
property of "baseclass" that I don't want exposed in the IDE. The MSDN
documentation says"

"A derived type can hide an inherited member by defining a new member with
the same signature. This might be done to make a previously public member
private or to define new behavior for an inherited method that is marked
as
final. "

However, this does not hide the property. For example, in my code;

dim c as myclass = new myclass

when I type c. the designer shows all the properties and methods and it
includes the property that I have made private in myclass.

Is there anyway that I can fix this?

--
Dennis in Houston

Nov 21 '05 #2
Dennis,

You see that with the picturebox as well where in my opinion the
backgroundcolor is shadowed (hidden). When you shadows it and make it
private as the documentation says, than is my expirience that it takes the
property from the base class.

I have searched on Google for that and the only thing I found was setting
<browsable> to false, however that does not work as well in the IDE itself.

This does not help you hoever shows that you are not the only one who is
looking for a way to do this.

I hope that it helps in that way?

Cor

"Dennis" <De****@discussions.microsoft.com>
..
I have a class named myclass that inheirits from "baseclass". There is a
property of "baseclass" that I don't want exposed in the IDE. The MSDN
documentation says"

"A derived type can hide an inherited member by defining a new member with
the same signature. This might be done to make a previously public member
private or to define new behavior for an inherited method that is marked
as
final. "

However, this does not hide the property. For example, in my code;

dim c as myclass = new myclass

when I type c. the designer shows all the properties and methods and it
includes the property that I have made private in myclass.

Is there anyway that I can fix this?

--
Dennis in Houston

Nov 21 '05 #3
"Dennis" <De****@discussions.microsoft.com> schrieb:
I have a class named myclass that inheirits from "baseclass". There is a
property of "baseclass" that I don't want exposed in the IDE. The MSDN
documentation says"

"A derived type can hide an inherited member by defining a new member with
the same signature. This might be done to make a previously public member
private or to define new behavior for an inherited method that is marked
as
final. "

However, this does not hide the property. For example, in my code;

dim c as myclass = new myclass

when I type c. the designer shows all the properties and methods and it
includes the property that I have made private in myclass.


You cannot completely remove the method -- this would stand against the
concepts of inheritance and extension by deriving. All you can do is
overriding (or maybe direclty shadowing) the method and specifying
'Browsable' and/or 'EditorBrowsable' attributes with appropriate value on
the member (these attributes are defined in the 'System.ComponentModel'
namespace).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #4
"Dennis" <De****@discussions.microsoft.com> schrieb:
I have a class named myclass that inheirits from "baseclass". There is a
property of "baseclass" that I don't want exposed in the IDE. The MSDN
documentation says"

"A derived type can hide an inherited member by defining a new member with
the same signature. This might be done to make a previously public member
private or to define new behavior for an inherited method that is marked
as
final. "

However, this does not hide the property. For example, in my code;

dim c as myclass = new myclass

when I type c. the designer shows all the properties and methods and it
includes the property that I have made private in myclass.


You cannot completely remove the method -- this would stand against the
concepts of inheritance and extension by deriving. All you can do is
overriding (or maybe direclty shadowing) the method and specifying
'Browsable' and/or 'EditorBrowsable' attributes with appropriate value on
the member (these attributes are defined in the 'System.ComponentModel'
namespace).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #5
Thanks for answers. Disappointing that VB.Net doesn't do what Microsoft says
it will.

"Dennis" wrote:
I have a class named myclass that inheirits from "baseclass". There is a
property of "baseclass" that I don't want exposed in the IDE. The MSDN
documentation says"

"A derived type can hide an inherited member by defining a new member with
the same signature. This might be done to make a previously public member
private or to define new behavior for an inherited method that is marked as
final. "

However, this does not hide the property. For example, in my code;

dim c as myclass = new myclass

when I type c. the designer shows all the properties and methods and it
includes the property that I have made private in myclass.

Is there anyway that I can fix this?

--
Dennis in Houston

Nov 21 '05 #6
Thanks for answers. Disappointing that VB.Net doesn't do what Microsoft says
it will.

"Dennis" wrote:
I have a class named myclass that inheirits from "baseclass". There is a
property of "baseclass" that I don't want exposed in the IDE. The MSDN
documentation says"

"A derived type can hide an inherited member by defining a new member with
the same signature. This might be done to make a previously public member
private or to define new behavior for an inherited method that is marked as
final. "

However, this does not hide the property. For example, in my code;

dim c as myclass = new myclass

when I type c. the designer shows all the properties and methods and it
includes the property that I have made private in myclass.

Is there anyway that I can fix this?

--
Dennis in Houston

Nov 21 '05 #7
Herfried brings up the attribute that you need in his reponse. The
EditorBrowsable attribute allows for 'hiding' a member from the auto list
feature in the IDE. You can select Never, Advanced, or Always. The Never
option will hide this method even if the IDE Setting under Tools->Options -
Text Editor All Languages (or individual language) shows the Hide advanced
members as unchecked.

One quirky thing about the EditorBrowsable setting is if a base class has
the method as browsable, and the derived does not, it will show the member
from the base class. This is confirmed by changing the case on the derived
class overridden or shadowed member. It will show the method character
casing from the base class, which has the browsable attribute allowing for
visibility in the auto list. This is strange, and a bit annoying.

The Browsable attribute allows for hiding within the design view property
window in the case of a custom control.

As far as the original article, 'hide' is the term that Microsoft uses in
this instance to specify that the method implementation is hidden when using
the derived class. The second part of the statement makes reference to this,
as it allows for changing the availability of the method from public to
private, or having new behavior. The method name itself was not hidden.

Hope this helps all.

"Herfried K. Wagner [MVP]" wrote:
"Dennis" <De****@discussions.microsoft.com> schrieb:
I have a class named myclass that inheirits from "baseclass". There is a
property of "baseclass" that I don't want exposed in the IDE. The MSDN
documentation says"

"A derived type can hide an inherited member by defining a new member with
the same signature. This might be done to make a previously public member
private or to define new behavior for an inherited method that is marked
as
final. "

However, this does not hide the property. For example, in my code;

dim c as myclass = new myclass

when I type c. the designer shows all the properties and methods and it
includes the property that I have made private in myclass.


You cannot completely remove the method -- this would stand against the
concepts of inheritance and extension by deriving. All you can do is
overriding (or maybe direclty shadowing) the method and specifying
'Browsable' and/or 'EditorBrowsable' attributes with appropriate value on
the member (these attributes are defined in the 'System.ComponentModel'
namespace).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: jlopes | last post by:
There seems to bet no diff between a vitual method and an inheirited method. class A_Base { public: virtual void filter(){ /* some code */ } }; class D_of_A_Base : public A_Base {
9
by: jlopes | last post by:
I'm looking at the differences between these to forms and see no difference in their use. When accessed through a derived class. class ABase { public: virtual void filter(){ /* some code */ }...
12
by: Alex Hunsley | last post by:
There's no really specific questions in this post, but I'm looking for people's thought on the issues within... The two main versions I've encountered for data pseudo-hiding (encapsulation) in...
6
by: Microsoft | last post by:
Base class: class AssetBase { string _clli; public string CLLI { get
7
by: Baski | last post by:
Base class: class AssetBase { string _clli; public string CLLI { get
4
by: Dan | last post by:
I have a need to make a set of classes that all share the same public methods, some implementation and some data. So, I made an abstract base (BaseClass) with an interface (IBaseClass) and a...
0
by: Dennis | last post by:
I have a class named myclass that inheirits from "baseclass". There is a property of "baseclass" that I don't want exposed in the IDE. The MSDN documentation says" "A derived type can hide an...
14
by: Dom | last post by:
Hi all I'm developing a control, and I need to hide some properties to the user. For example, suppose I need Text property to be completely inacessible (from a Form/Code that is into another...
162
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.