MainMenu disappearing
-
Hi Folks, I have a MDI Parent form which has its own MainMenu. At design time everything is fine, but at run time the Main Menu disappears. After some testing, I found out that if the form's IsMDIContainer property is set to false, the Main Menu appears. If I set IsMDIContainer = true just before loading any MDI Child, the menu shows, but it wont merge with the Child menu items, besides, the MDiList of the parent wont update. I've even tried to create the Main menu in the Load event of the form, but its the same. Any suggestion? I've ran out of ideas here
-
Hi Folks, I have a MDI Parent form which has its own MainMenu. At design time everything is fine, but at run time the Main Menu disappears. After some testing, I found out that if the form's IsMDIContainer property is set to false, the Main Menu appears. If I set IsMDIContainer = true just before loading any MDI Child, the menu shows, but it wont merge with the Child menu items, besides, the MDiList of the parent wont update. I've even tried to create the Main menu in the Load event of the form, but its the same. Any suggestion? I've ran out of ideas here
While I am not sure of the various properties set by you for the menu items of the MDI form and Child form, I may add that generally speaking, by default, MDI parent forms add MDI child menus automatically. Two properties, "MergeType" and "MergeOrder", determine how individual menu items are handled during a menu merge and the relative position of each MenuItem in the newly-merged menu. You can set these properties on MenuItems individually or collectively to determine the items' presence and location within a menu merge. Also remember the use of the "MenuMerge" enumeration which has 4 members, namely, "Add", "MergeItems", "Replace" and "Remove". These members can create various combinations for the merged menus, and depending upon the selected option the merged menu may not show properly. So, you may like to check the values of "MergeType" and "MergeOrder" properties of menu items on the MDI Form and Child forms. Try using the value of the "MergeType" property as "Add" instead of "Replace" or "Remove" if the latter values are set in your code. This can be done at design time as well. If it does not help you, please try to give some more details of your problems.
-
While I am not sure of the various properties set by you for the menu items of the MDI form and Child form, I may add that generally speaking, by default, MDI parent forms add MDI child menus automatically. Two properties, "MergeType" and "MergeOrder", determine how individual menu items are handled during a menu merge and the relative position of each MenuItem in the newly-merged menu. You can set these properties on MenuItems individually or collectively to determine the items' presence and location within a menu merge. Also remember the use of the "MenuMerge" enumeration which has 4 members, namely, "Add", "MergeItems", "Replace" and "Remove". These members can create various combinations for the merged menus, and depending upon the selected option the merged menu may not show properly. So, you may like to check the values of "MergeType" and "MergeOrder" properties of menu items on the MDI Form and Child forms. Try using the value of the "MergeType" property as "Add" instead of "Replace" or "Remove" if the latter values are set in your code. This can be done at design time as well. If it does not help you, please try to give some more details of your problems.
Yes, I also played with that. I have 3 MDI child forms at the moment, one of them has NO menu at all, and the other two have 'MergeType' set to Add, each of them with the appropiate MergeOrder value, but the problem is the same, the Menu from the Main form keeps disappearing. Anyway, after a couple of hours more trying to fix it, I decided to use the MenuBar provided in the user interface suite we generally use (Janus controls). I am reluctant to use them because these fancy UI controls are memory swallowers, but for this MDI problem they work, so to hell with VS MainMenus. Thanks for the reply though, Dr Ashok.