I am trying to create a dynamic flyout submenu off of a contextmenu.
I can right click and get the base contextmenu ok.
On the Popup event I add MenuItem's to the collection of one of the items so
it has a flyout submenu when selected.
If I try and add more than 1 item to the submenu it only shows up the first
time.
This same code works fine if it is part of a MainMenu but not with a
ContextMenu.
Has anyone seen this before? Have you found a work around?
Here is a sample of the code that I use in the Popup event for the
contextmenu.
(mnuExisting is one of the menu items in the context menu)
MenuItem[] aMi = new MenuItem[2];
aMi[0] = new MenuItem("SubMenu Item 1");
aMi[1] = new MenuItem("SubMenu Item 2");
mnuExisting.MenuItems.Clear();
mnuExisting.MenuItems.AddRange(aMi);
This will work the first time the contextmenu it shown but the submenu
doesn't show after that.
If I change this to add an array of 1 it works every time.
Thanks for any help.