// in your CMainFrame class, create a CToolBar // that includes the TBSTYLE_WRAPABLE and // CBRS_SIZE_FIXED flags. // next, call the SetRows() method. have a look // at the MSDN docs for a full desciption of the // method and its parameters. int numRows; // TODO: initialise this value m_wndToolBarFloat.GetToolBarCtrl().SetRows(numRows, true, 0); // last, dock the tool to the left or right side // of the MDI frame m_wndToolBarFloat.EnableDocking(CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT); EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndToolBarFloat);