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.
LVL 1
Michael SterlingWeb Applications DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michael SterlingWeb Applications DeveloperAuthor Commented:
as a follow up, maybe another question i can/should ask is,..in a DockDrop or DockOver event you have "Source" as part of your parameter list how do i grab the Source's MainMenu item (presumming that i know there will be one ahead of time) and assing it to the main menu item of the form i'm docking to?
0
Geert GOracle dbaCommented:
a menu has a procedure called merge
to merge the menu of the docked form to the main window:

MainForm.Menu.Merge(DockedForm.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
0
Geert GOracle dbaCommented:
the question was answered and like this statement below says from ziolko :

but you asked the question and we've answered it, points are given for answers not for what you need or don't need anymore

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.