I am adding to the ADVMemo context menu with a number of additional items. I create a a Popup menu and populate it with the additional items and on CustomiseContextMenu I add the additional menu items. This works fine however, when I try and add a submenu to one of the items in the extended Context Menu I get the error "Menu Inserted Twice". This is the code I am using to add the submenu...
ContextMenu.Items[10].Add(mnu);
Where mnu is a supposed to be a sub menu which is created at run time.
I have also tried Insert but that has the same result.
I then tried modifying the Menu Extension popup at design time by adding a few dummy submenus into the popup. When I run my app and invoke the popup menu these submenu do not appear in the ContextMenu.
Either you extend the built-in popup menu via the event OnCustomizeContextMenu from where you use the parameter ContextMenu and add menu items or you put your own popup menu on the form and assign it to AdvMemo.PopupMenu.
When you add menu items via OnCustomizeContextMenu , the menu items are managed by TAdvMemo and will be destroyed by TAdvMemo when it closes. When you add references there to an existing popupmenu on the form, the form will destroy these and the memo will try to, resulting in an error.