我在程序中做了两个controlbar,并将他们并排置于主界面的下部,可我却没办法使它们宽度相同,也就是各占主界面的下部的一半。程序执行时总是一个宽一个窄,真是不爽阿,我的cmainframe的oncreate中的代码如下,请哪位高人指点一下,谢了!// Create the output bar.
if (!m_wndOutputBar.Create(this, IDW_OUTPUTBAR, _T("Output"),
CSize(150, 150), CBRS_BOTTOM))
{
TRACE0("Failed to create output dock window\n");
return -1; // fail to create
} // Create the detail bar.
if (!m_wndDetailBar.Create(this, IDW_DETAILBAR, _T("detail"),
CSize(150, 150), CBRS_BOTTOM))
{
TRACE0("Failed to create output dock window\n");
return -1; // fail to create
} m_wndOutputBar.EnableDockingEx(CBRS_ALIGN_ANY, CBRS_XT_ALL_FLAT|CBRS_XT_GRIPPER_GRAD);
m_wndDetailBar.EnableDockingEx(CBRS_ALIGN_ANY, CBRS_XT_ALL_FLAT|CBRS_XT_GRIPPER_GRAD);
EnableDockingEx(CBRS_ALIGN_ANY, CBRS_XT_ALL_FLAT);
DockControlBar(&m_wndDetailBar);
DockControlBar(&m_wndOutputBar);
DockControlBarLeftOf( &m_wndDetailBar, &m_wndOutputBar );

解决方案 »

  1.   

    HeHe.You are using eXtren GUI library!
    Trying this:
    DockControlBar(&m_wndOutputBar,AFX_IDW_DOCKBAR_BOTTOM);
    RecalcLayout();
    CRect rect;
    m_wndOutputBar.GetWindowRect(&rect);
    ScreenToClient(rect);
    rect.MoveRect(rect.Width()/2,0,0,0);
    DockControlBar(&m_wndDetailBar,AFX_IDW_DOCKBAR_BOTTOM,&rect);
      

  2.   

    to zhujianping_es(DavidRipple) :
         我试了你的办法,效果是两个controlbar一上一下置于主界面的下方,并不是一左一右,不知道是怎么回事?请明示在下,万分感谢!
      

  3.   

    另注:MoveRect不是CRect的成员函数,我用了OffsetRect
      

  4.   

    Sorry!I couldn't try your example on my computer!
    So,I could only give you suggestion by imagination!
      In this situation,I think you could think about using CRebar class.
    Put the CRebar at the bottom and then add your two control bars.
      

  5.   

    to phoenixzz(小百货):
        那你说该如何设置呢?