Problem with base constructor

  • Thread starter Thread starter Paul E Collins
  • Start date Start date
P

Paul E Collins

I want to create a class that inherits from Menu and whose constructor
calls the parameterless Menu constructor.

Why does this code produce CS1501 ("No overload for 'Menu' takes '0'
arguments")? How can I correct it?

public class DerivedMenu : System.Windows.Forms.Menu
{
public DerivedMenu(string xyz) : base()
{
// some code here
}
}

P.
 
Paul,

The Menu class does not have a base constructor that takes zero
arguments. You need to pass the items parameter in, which is an array of
MenuItem instances.

Hope this helps.
 
Back
Top