Hi All,

I have created a menu in another class than the form class. A method in this class returns the meny, and in the form the form.Menu is assigned the result.
The menu exists and all is fine. The call from the form below:
Code:
this.Menu = logik1.fillMenu();
Now I want to add an event to this menu. I would assume that all menuitems (subitems) for this menu would be accessible through this.Menu because that was assigned the created menu.

How can I add en event for one of the menuitems (openMenu) as below
Code:
this.openMenu.Click += new System.EventHandler(this.openMenu_Click);
I get an error saying that my form is not containing a definition for openMenu, which is true but since form.Menu is assigned the menu, I think it should be accessable???

The method in class logik1 that creates the method looks like this:
Code:
MainMenu mainMenu1 = new MainMenu();
MenuItem openMenu = new MenuItem();
openMenu.Text = "Open";
mainMenu1.MenuItems.Add(openMenu);
Regards

Jonni