Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Merging Menus problem 2

Status
Not open for further replies.

sggaunt

Programmer
Jul 4, 2001
8,620
GB
Hi
Does anyone know if there is a way to do this.
I am trying to merge the menu of the child window with a main form menu. and want to retain the 'Exit' sub item from the main menu item 'File' .
If I give the Child form 'File' menu the same item index as the main form 'File' menu the main form menu always disapears entirly even if the 'Exit' item has a different item index.
If I give the 'File' menus diffrent item indexes I get 2 'File' menus.

Steve
 
On your main Form set the TMainMenu property
automerge = false

On your child Form set
automerge = true

If the group index is the same the child form MainMenu will be displayed.

In the Exit OnClick event of your childform type
Application.Terminate


In the Exit OnClick event of your Mainform type
Close

If you are experiencing Access Violations, check the automerge property on the forms

Regards S. van Els
SAvanEls@cq-link.sr
 
Thanks for that Svanels
Seems to work OK, I knew there had to be a simple answer to this but I hadn't checked the value of 'automerge' as the Delphi help states that it is ignored in MDI applications !!!

This has been affecting several of my apps for years. Thanks very much Steve.



 
PS

I diddnt give you the star last time , but I should have, so here is another one!
Steve.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top