Toll Free: (877) 723-1442 U.S. and Canada
Support
ActiveX / COM
Visual C++ / MFC
Customer Spotlight
Corporate Partners
Contact Sales

Call center available M-F 9:00 - 6:00 US Eastern Time.

U.S. and Canada
(877) 723-1442

International
(517) 625-5729

Email

Add or Remove CommandBar MDI Buttons

Author: Mike Palmatier
Posted: February 23, 2006
Environment: Visual Basic 6.0

You can add or remove MDI buttons that control the child windows in a MDI application. The CommandBars.SetFlags method is used to apply one of the flags from the XTPMenuBarFlags enumeration.

Menu bar with the system MDI popup added

Menu bar with the minimize MDI button hidden

Menu bar with the maximize MDI button hidden

Menu bar with the close MDI button hidden

Menu bar with the all MDI buttons hidden

This sample code illustrates how to add a MDI popup control on the menu bar.

 

     CommandBars(1).SetFlags xtpFlagAddMDISysPopup, 0

 

This sample code illustrates how to hide all MDI buttons on the menu bar.

 

     CommandBars(1).SetFlags xtpFlagHideMDIButtons, 0

 

This sample code illustrates how to hide the maximize MDI button on the menu bar.

 

     CommandBars(1).SetFlags xtpFlagHideMaximizeBox, 0

 

This sample code illustrates how to hide the minimize MDI button on the menu bar.

 

     CommandBars(1).SetFlags xtpFlagHideMinimizeBox, 0

 

This sample code illustrates how to hide the close MDI button on the menu bar.

 

     CommandBars(1).SetFlags xtpFlagHideClose, 0

 

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Other products and/or company names may be trademarks or registered trademarks of their respective owners.