我建立了多个工具栏,在界面上显示的时候是一个挨着一个的,由上而下,
如何设置 能让这多个工具栏 在同一行上。如何修改属性 和移动 来实现以上效果。

解决方案 »

  1.   

    直接可以用 MoveWindow 或者SetWindowPos 就可以吧、
      

  2.   

    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 
    RecalcLayout(); 
    LeftOf-> GetWindowRect(&rect); 
    rect.OffsetRect(1,0); 
    dw=LeftOf-> GetBarStyle(); 
    n   =   0; 
    n   =   (dw&CBRS_ALIGN_TOP)   ?   AFX_IDW_DOCKBAR_TOP   :   n; 
    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   in   effect 
    //   are   simulating   a   Toolbar   being   dragged   to   that   location   and   docked. 
    DockControlBar(Bar,n,&rect);