The new vbAccelerator Site - more VB and .NET Code and Controls
Source Code
1 VB 5 Custom Controls &nbsp


 NOTE: this code has been superceded by the version at the new site.



&nbsp

Adding menu icons to MDI projects with multiple child menus

Demonstration Project

VB5 codeDownload the MDI/Icon Menu demonstration project (23kb)

&nbsp Before you Begin &nbsp
&nbsp This project requires the Icon Menu control. Make sure you have loaded and registered this before trying the project. &nbsp
&nbsp The Icon Menu control requires the SSubTmr.DLL component. Make sure you have loaded and registered this before trying the project. &nbsp
This project demonstrates how to use the new NewMDIMenu event in the Icon Menu control to provide iconised menus in MDI projects with child forms which have their own menus.

Whenever the menu in the MDI form changes due to a new child form with its own menu being loaded, the IconMenu control will raise the NewMDIMenu event. At this stage you can inform the child form that the IconMenu control has detected that the menu has changed and it should set up all the items in the menu. The child form should respond by calling the SubClassMenu method and then setting up the icons it wants.

When a child form with its own menu is unloaded, it should call the UnSubClassMenu method. This ensures that any extra menu items which were created by the child form are cleared up. If you don't create any new menu items whilst the child form is running, it won't matter whether you call this method. If you do, but fail to call it, the menus you have created will not be destroyed until the application ends. This would leads to a small (but ultimately disastrous if you left the project running long enough and kept opening and closing child forms) resource leak.



TopBack to top
Source Code - What We're About!Back to Source Code

&nbsp


 NOTE: this code has been superceded by the version at the new site.



 

About  Contribute  Send Feedback  Privacy

Copyright © 1998-1999, Steve McMahon ( steve@vbaccelerator.com). All Rights Reserved.
Last updated: 10 January 1999