473,396 Members | 1,784 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,396 software developers and data experts.

How are inherited methods/properties hidden?

Hello!

While using panel control, I wondered a thing.
Panel class is subclass of Control class.
Control class has KeyPress event and Focus() method, etc...
Then Panel class must have them.
I guess it *has* then behind even if they are not meaningful.
However, the code complete tool doesn't show them when I type panel1.(code
complete list).
Actually I can type panel1.Focus() without any compilation error.
It has no effect, thought.

What's going on?
Is it VS function or language feature to hide the meaningless
methods/proeprties?

Thanks.

Sam
Nov 16 '05 #1
3 1583
Sam,

None of the methods should be hidden. You should see all of the
methods/properties/events of the Control class (assuming they are public).

Hope this helps.
"Sam Sungshik Kong" <ss*@chol.nospam.net> wrote in message
news:eg**************@TK2MSFTNGP11.phx.gbl...
Hello!

While using panel control, I wondered a thing.
Panel class is subclass of Control class.
Control class has KeyPress event and Focus() method, etc...
Then Panel class must have them.
I guess it *has* then behind even if they are not meaningful.
However, the code complete tool doesn't show them when I type panel1.(code
complete list).
Actually I can type panel1.Focus() without any compilation error.
It has no effect, thought.

What's going on?
Is it VS function or language feature to hide the meaningless
methods/proeprties?

Thanks.

Sam

Nov 16 '05 #2
Nicholas,

Thanks for your reply.

I know that methods shouldn't be hidden.
What I want to know is how the code complete tool knows which methods are
meaningless.

You try the following:

panel1. <= only some of methods/properties of Panel class are shown.
((Control)panel1). <= all of methods/properties of Control class are shown.

As Panel class is a subclass of Control class, the methods/properties of
Panel class must include all methods/properties of Control class.
However, some of them are missing in the code complete tool, which is very
tricky and useful.

Could you explain how it works?

Sam

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uv**************@TK2MSFTNGP09.phx.gbl...
Sam,

None of the methods should be hidden. You should see all of the
methods/properties/events of the Control class (assuming they are public).

Hope this helps.
"Sam Sungshik Kong" <ss*@chol.nospam.net> wrote in message
news:eg**************@TK2MSFTNGP11.phx.gbl...
Hello!

While using panel control, I wondered a thing.
Panel class is subclass of Control class.
Control class has KeyPress event and Focus() method, etc...
Then Panel class must have them.
I guess it *has* then behind even if they are not meaningful.
However, the code complete tool doesn't show them when I type panel1.(code complete list).
Actually I can type panel1.Focus() without any compilation error.
It has no effect, thought.

What's going on?
Is it VS function or language feature to hide the meaningless
methods/proeprties?

Thanks.

Sam


Nov 16 '05 #3
It is set by the attributes of the methods / properties like this

[
Browsable(false), // will hide it from the properties pane
EditorBrowsable(EditorBrowsableState.Never) // will hide it from
intellisense
]

You can still access these properties by typing it into the code but they
will not show up in intellisense etc..

HTH
JB

"Sam Sungshik Kong" <ss*@chol.nospam.net> wrote in message
news:uy**************@TK2MSFTNGP11.phx.gbl...
Nicholas,

Thanks for your reply.

I know that methods shouldn't be hidden.
What I want to know is how the code complete tool knows which methods are
meaningless.

You try the following:

panel1. <= only some of methods/properties of Panel class are shown.
((Control)panel1). <= all of methods/properties of Control class are shown.
As Panel class is a subclass of Control class, the methods/properties of
Panel class must include all methods/properties of Control class.
However, some of them are missing in the code complete tool, which is very
tricky and useful.

Could you explain how it works?

Sam

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:uv**************@TK2MSFTNGP09.phx.gbl...
Sam,

None of the methods should be hidden. You should see all of the
methods/properties/events of the Control class (assuming they are public).

Hope this helps.
"Sam Sungshik Kong" <ss*@chol.nospam.net> wrote in message
news:eg**************@TK2MSFTNGP11.phx.gbl...
Hello!

While using panel control, I wondered a thing.
Panel class is subclass of Control class.
Control class has KeyPress event and Focus() method, etc...
Then Panel class must have them.
I guess it *has* then behind even if they are not meaningful.
However, the code complete tool doesn't show them when I type

panel1.(code complete list).
Actually I can type panel1.Focus() without any compilation error.
It has no effect, thought.

What's going on?
Is it VS function or language feature to hide the meaningless
methods/proeprties?

Thanks.

Sam



Nov 16 '05 #4

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

Similar topics

7
by: Tron Thomas | last post by:
Under the right compiler the following code: class Base { public: virtual void Method(int){} }; class Derived: public Base {
2
by: dsandor | last post by:
I have a class that is inherited by another class. Let say: public class vehicle { public string color { get ... set ... } }
5
by: Earl Teigrob | last post by:
Is there a way to rename the public properties of a inherited class? I am inheriting an asp.net control (class) and am adding addtional functionality. (in this case, up to 3 borders on an...
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: Paul Lyons | last post by:
Hi, I've been having an issue using reflection and custom attributes to create objects on the fly. I was wondering if this was expected behaviour or a known bug? When using Type.GetMembers()...
1
by: Thomas Ott via .NET 247 | last post by:
Salve, having inherited from InheritsSystem.Web.UI.WebControls.WebControl, I want to hide someproperties and methods. So I...
3
by: Wayne Brantley | last post by:
VS2005 RTM Create a web user control to use as a base class for other web user controls. Now, create a new web user control, change the class it inherits from to your base class and compile....
10
by: Smokey Grindle | last post by:
i want to inherit the list view class, but in the inherited class, hide the Header style property and the view property (basically its a detailed list with always clickable headers) how do I keep...
13
by: PragueExpat | last post by:
I (think) that I've come up with a pattern that I haven't seen in any publications so far and I would like some feedback. Basically, I was looking for a way to inherit private functions and I came...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.