Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add menu item at runtime

Status
Not open for further replies.

adrianjohnson

Programmer
May 16, 2002
145
GB
I seem to be struggling with this, yet it should be so easy.

I've got a winform, with a main menu already created. However, I want to add items to the main menu when the program is running.

I've already tried the code from here:
but it doesn't seem to like it.

The code I have so far is:

Code:
MenuItem newItem = new MenuItem("Item 1");
FormMain.MyMenu.MenuItems.Add(newItem);

but that doesn't compile either.

Where am I going wrong?

Thanks,

Adrian


Adrian Johnson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top