d g

d g

  • NA
  • 19
  • 0

contextMenuStrips aren't dynamic?

Jun 11 2006 11:29 AM


My question is concerning the difference between contextMenuStrips and the old contextMenus.

contextMenus are easily dynamic, for instance:

contextMenu menu1 = new contextMenu();
menu1.MenuItems.Add("first");
menu1.MenuItems.Add("second");
menu1.MenuItems[1].MenuItems.Add("submenu of second");
... etc

however, I can't seem to find the same flexibility in the contextMenuStrips... MSDN ignorantly states that their example is dynamic...
(http://msdn2.microsoft.com/en-us/library/system.windows.forms.contextmenustrip.aspx)

but it hardcodes names and structure... thats not dynamic creation... their example is only an example of what is done when you visually create the contextMenuStrip at design time... I want to build the contextMenuStrip menus not knowing at design time anything at all about the structure or names of the menu items...


Answers (1)