By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,771 Members | 1,709 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,771 IT Pros & Developers. It's quick & easy.

How are inherited methods/properties hidden?

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.