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/>