Professional UI Solutions
Site Map   /  Register

Dynamic Control Bars

What are dynamic control bars?

The dynamic control bars (instances of the CExtDynamicControlBar controlled by the global CExtDynamicBarSite object) are the control bars which in addition to features provided by the ordinary CExtControlBar class (like docking/floating, tab grouping, auto hide, serialization and multi monitor support) allow the user to switch them into the mode when their content is displayed as tabbed documents in MDI/SDI applications. This makes it possible to visualize document data and control bar content, which are completely different by their nature, in one consistent way. The classic example of implementing such a tabbed interface is Visual Studio NET/2005 (the Tabbed documents mode).

MFC Prof-UIS: Dynamic control bar's content as a tabbed document

Dynamic control bars can also be of great help for you in case you need to serialize your dynamic control bars more than once during the application instance's lifetime. For example, you have an application whose instance serves for many users and each user gets its own restored GUI state (the layout of control bars, their visibility, and etc.) when they log in in turn (without the necessity to restart the application).

Prof-UIS provides two samples that demonstrate how to use dynamic control bars: MDI_DynamicBars and SDI_DynamicBars.

To learn more, please read the Dynamic Control Bars for MDI and SDI Applications with Tabbed Interface article.

How to traverse dynamic control bars?

The typical scenario of iterating around all/relevant nodes is as follows:

//Always get the start position before traversing
POSITION pos = BarEnumGetStartPosition();
for( ; pos != NULL; )
	CExtDynamicControlBar * pBar = 
			true, // Specify persistent dynamic bars with true
			true// Specify simple dynamic bars with true
	// do what you need

How to make dynamic control bars always visible in the pop-up menu with a list of all control bars?

By default, all the commands associated with menu items are regarded as not frequently used and to show them the user needs to click the round down arrow button. To make them always visible, get their command objects from the command manager and invoke the CExtCmdItem::StateSetBasic (bool bOn = true) method for them:

UINT nCmdID = (UINT)m_pDynamicBar->GetDlgCtrlID();
CExtCmdItem * pCmdItem = 
ASSERT( pCmdItem != NULL );

If you have any questions, please visit our forum or contact our technical support team at