Dynamic Menu loading
I'm looking for a method to load menus dynamically without the UI shift that
is caused when using the MenuItems.Clear method.
This application has different views, all of which are more or less self
contained within DLL's. When a view is selected, that DLL is loaded, the
Menu, toolbar buttons, etc for that view are then loaded into the parent.
If the MenuItems.Clear method did not cause the rest of the UI to shift upwards
(ie if it could be frozen similar to the .BeginUpdate method for a ListBox),
then it would work perfectly.
MergeMenu doesn't work as each 'view' is responsible for providing its content
specific resources and replaces the entire menu when loaded.
Currently, I use .MenuItems.RemoveAt and remove all but the 0th element,
load the new menu and then drop that last (first) element. While this works,
there is still some noticeable flash / flicker I would like to get rid of.
I have ruled out the more standard methodology of dynamically adding and
removing individual items as the Views load and unload, managing the menu
events within the parent object as the design requires they not only provide
their own menu, but handle the menu messages as well.