Michael Sterling
asked on
attach a main menu to a unit
i've created a customized unit (a TForm Class) and have created a TMainMenu component in code. I need to make sure that when forms of this class are created that the TMainMenu item gets assigned and shows on the form,..how do i do this? Ultimately what i'm trying to do is "transfer" an existing main menu from a form that gets docked inside of another form, so that the receiving form gets the menu, since i lose the original main menu when the dock is complete.
a menu has a procedure called merge
to merge the menu of the docked form to the main window:
MainForm.Menu.Merge(Docked Form.Menu) ;
for the merge to work correctly you need to set the GroupIndex property of each main menu item
Like in the MainMenu set File GroupIndex to 1, Help to 100
For a dockedform you could set GroupIndex to 90
They get ordered by this groupindex in the combined menu
to merge the menu of the docked form to the main window:
MainForm.Menu.Merge(Docked
for the merge to work correctly you need to set the GroupIndex property of each main menu item
Like in the MainMenu set File GroupIndex to 1, Help to 100
For a dockedform you could set GroupIndex to 90
They get ordered by this groupindex in the combined menu
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER