Hello, I appreciate it if someone can help me to diagnose the following problem: right now I'm trying to put two CMFCToolBars on a vs2010 SDI application. But they are having alignment problems now. The first toolbar falls nicely under the menubar, but the second seems always flying around. At most cases, it appears vertically attached to the left edge of the client area... I was playing this all day long and have to ask some ideas here. I believe this is a interesting question as I notice some people had this problems but there were only some likely solutions for VS6...
Thanks.
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(1, 1, 1, 1), IDR_MAINFRAME_256 ) ||
!m_wndToolBar.LoadToolBar( IDR_MAINFRAME_256 ))
{
TRACE0("Failed to create toolbar\n");
return -1; }
m_wndToolBar.SetWindowText(_T("test1"));
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
if (!m_wndToolBar1.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(1, 1, 1, 1), IDR_SORT )||
!m_wndToolBar1.LoadToolBar(IDR_SORT))
{
TRACE0("Failed to create toolbar\n");
return -1; }
m_wndToolBar1.SetWindowText(_T("test"));
m_wndToolBar1.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndToolBar);
DockPane(&m_wndToolBar1);
What I have tried:
two CMFCToolBars docking problems in VS2010