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