I'm trying to merge two main menus together, but am having problems getting the right result with sub-items. I'm using the GroupIndex property on my MenuItems to control the merging/insertion.
Menu1 (with groupindices) is like this
- File=10
- Open=11
- Close=12
- Edit=20
- Cut=21
- Paste=22
- Help=90
- About=91
Menu2 is like this
- Edit=20
- Clear=23
- Widgets=30
- Widget1=31
- Widget2=32
And I'm doing
Menu1.Merge(Menu2);
I want the combined menu to have a new top menu "Widgets"and a new "Clear" command in the Edit menu. "Widgets" is working fine, but the Edit Menu has lost cut and paste, which wasn't what I wanted.
How can I stop the Cut and Paste commands from disappearing?