hiding an overload

  • Thread starter Thread starter Eric Cadwell
  • Start date Start date
E

Eric Cadwell

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top