问如何布置多个dialogbar的位置,并在 view中实现隐藏和出现的切换(谢谢各位)  最好有个例子。[email protected]

解决方案 »

  1.   

    1.就是DockControlBar(...);了,仔细理解其参数就行了。2.ShowControlBar(...)
      

  2.   

    参数帮你贴出来!
    void DockControlBar( CControlBar * pBar, UINT nDockBarID = 0, LPCRECT lpRect = NULL );ParameterspBarPoints to the control bar to be docked.nDockBarIDDetermines which sides of the frame window to consider for docking. It can be 0, or one or more of the following: AFX_IDW_DOCKBAR_TOP   Dock to the top side of the frame window.
    AFX_IDW_DOCKBAR_BOTTOM   Dock to the bottom side of the frame window.
    AFX_IDW_DOCKBAR_LEFT   Dock to the left side of the frame window.
    AFX_IDW_DOCKBAR_RIGHT   Dock to the right side of the frame window.
    If 0, the control bar can be docked to any side enabled for docking in the destination frame window.lpRectDetermines, in screen coordinates, where the control bar will be docked in the nonclient area of the destination frame window.
      

  3.   

    例子已经发给你了。
    其中顺序调用CReBar类折AddBar函数可以布置Dialogbar1及Dialogbar2的位置。
    利用以下的实现方式可以实现Dialogbar1的显示、隐藏的奇偶控制。(Dialogbar2处理相同)void CMainFrame::OnViewDialogbar1() 
    {
    BOOL bVisible = ((m_wndDialogBar1.GetStyle() & WS_VISIBLE) != 0);
    m_wndDialogBar1.ShowWindow(!bVisible);
    RecalcLayout();
    }void CMainFrame::OnUpdateViewDialogbar1(CCmdUI* pCmdUI) 
    {
    BOOL bVisible = ((m_wndDialogBar1.GetStyle() & WS_VISIBLE) != 0);
    pCmdUI->SetCheck(bVisible);
    RecalcLayout();
    }