MFC DialogBar Example

MFC DialogBar Explained With Example

In this example, we will see how to create and use MFC DialogBar Control. The DialogBar acts like a toolbar. Unlike toolbar, a dialog bar can have controls which we can place in it treating it as dialog. One can dock the DialogBar like a toolbar. To better visualize it, we can think of a tool bar with a radio button, a checkbox and a combo box in it. What we just now imagined can be easily achieved through a DialogBar control.

In this example we will design an MFC DialogBar, then we will place that in a Rebar Control so that we can dock it on the Main Frame window of the SDI application.

The MFC Rebar Example

MFC Rebar Control – Enable Floating Toolbar

Our example is a Single Document Interface (SDI) application, which shows six toolbar buttons in two ToolBars. These two ToolBars are hosted by the Rebar Control. Placing the ToolBar on the Rebar allows the user to move the toolbar over the Rebar Control using the Gripper. Using the grippers, we can also place a toolbar in separate rows. Let us start building this example.