Using the Xtreme Toolkit Pro toolbar

Xtreme Toolkit Pro is the most comprehensive interface control package in MFC development. It provides 11 mainstream Visual C + + MFC controls needed for Windows development, including command bars, controls, chart pro, calendar, docking panel, property grid, report control, shortcut bar, syntax edit, skin framework and task panel. If you are interested in the product, please go to Huidu to download the latest trial version of Xtreme Toolkit Pro ! Click to get more free Xtreme Toolkit Pro tutorials, videos and examples

There are many articles about docking toolbars. But I think it’s important to find the same information on Microsoft’s MSDN site. In short

Add the following methods to your CMainFrame class:

void CMainFrame::DockControlBarLeftOf(
                        CToolBar* Bar, CToolBar* LeftOf)
    CRect rect;
    DWORD dw;
    UINT n;

    // get MFC to adjust the dimensions of all docked ToolBars
    // so that GetWindowRect will be accurate

    n = 0;
    n = (dw&CBRS_ALIGN_BOTTOM && n==0) ?
                                AFX_IDW_DOCKBAR_BOTTOM : n;
    n = (dw&CBRS_ALIGN_LEFT && n==0) ?
                                AFX_IDW_DOCKBAR_LEFT : n;
    n = (dw&CBRS_ALIGN_RIGHT && n==0) ?
                                AFX_IDW_DOCKBAR_RIGHT : n;

    // When we take the default parameters on rect, DockControlBar
    // will dock each Toolbar on a seperate line. By calculating a
    // rectangle, we are simulating a Toolbar being dragged to that
    // location and docked.

Now, instead of using dockcontrolbar in your CMainFrame:: oncreate, use dockcontrolbar leftof:


This will stop M_ M on the left side of wndtoolbar1_ wndToolBar2。 Click to get the demo corresponding to the article.

That’s all for today, download the latest version of Xtreme Toolkit Pro and share your thoughts on the product in the comments area below. Your feedback can help us find the right direction in the future update!

Similar Posts: