473,468 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

hiding an overload

I'm inheriting from From, but my Show method requires a parameter, so I
define an overloaded Show method:
public void Show(Form Owner)

Now I get intellisence for two methods:
Control.Show()
MyForm.Show(Form Owner)

I need to hide Control.Show(). I tried hiding it...
private new void Show()

....and I tried setting EditorBrowsableAttribute...
EditorBrowsable(EditorBrowsableState.Never)
public new void Show()

Neither approach works. EditorBrowsable actually removes both overrides,
even if the correct version is also marked EditorBrowsableState.Always.

Any other ideas?

TIA,
Eric
Nov 15 '05 #1
1 1303
Not sure how to hide the overload, but what you could do, is if the show
method is called without specifying the owner parameter, throw an
ArgumentException. Not an ideal solution, but it might help achieve what
you're looking for (calling the show method without specifying the owner
form).

Hope this helps.

Mun

--
Munsifali Rashid
http://www.munsplace.com/


"Eric Cadwell" <ec******@ns.insight.com> wrote in message
news:eh**************@TK2MSFTNGP09.phx.gbl...
I'm inheriting from From, but my Show method requires a parameter, so I
define an overloaded Show method:
public void Show(Form Owner)

Now I get intellisence for two methods:
Control.Show()
MyForm.Show(Form Owner)

I need to hide Control.Show(). I tried hiding it...
private new void Show()

...and I tried setting EditorBrowsableAttribute...
EditorBrowsable(EditorBrowsableState.Never)
public new void Show()

Neither approach works. EditorBrowsable actually removes both overrides,
even if the correct version is also marked EditorBrowsableState.Always.

Any other ideas?

TIA,
Eric


Nov 15 '05 #2

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

Similar topics

5
by: Amir S. | last post by:
Hi, I'm a newbie to C++ (2 weeks into the course). We were given this assignment to write some code that reads a set of integers (grades) from a file (filename passed by console), outputs them...
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 {
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
17
by: Bob Weiner | last post by:
What is the purpose of hiding intead of overriding a method? I have googled the question but haven't found anything that makes any sense of it. In the code below, the only difference is that...
9
by: bob | last post by:
Hi, I know there exists a good reason why the designers of c++ decided that function hiding should exist. But I don't know why. Can anybody provide a good reason/example of a case where function...
2
by: Frederick Gotham | last post by:
Is there any way to prevent hiding of a base class function? I want the derived class to add an overload of the function, rather than hide the base class one. The following snippet demonstrates...
3
by: Thomas Kowalski | last post by:
Hi everyone, following situation: class A { void m(T value) =0; } class B : A {
5
by: jknupp | last post by:
In the following program, if the call to bar does not specify the type as <int>, gcc gives the error "no matching function for call to ‘bar(A&, <unresolved overloaded function type>)’". Since bar...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.