想实现类似Windows 资源管理器的效果,MainFrame中采用CSplitterWnd 产生了两个视图,
CLeftView,CMainView,  现在需要通过响应菜单命令 隐藏、显示CLeftView,
不知如何实现?????
1.m_wndSplitter.GetPane(0,0)->ShowWindow(SW_HIDE);
2.m_wndSplitter.DeleteView(0,0);
两个方法都试了,CMainView 不能自动扩充CLeftView的占据空间
?????????????

解决方案 »

  1.   

    RecalcLayout()SetColumnInfo or SetRowInfo
      

  2.   

    CFrameWnd::RecalcLayout  
    virtual void RecalcLayout( BOOL bNotify = TRUE );ParametersbNotifyDetermines whether the active in-place item for the frame window receives notification of the layout change. If TRUE, the item is notified; otherwise FALSE.ResCalled by the framework when the standard control bars are toggled on or off or when the frame window is resized. The default implementation of this member function calls the CWnd member function RepositionBars to reposition all the control bars in the frame as well as in the main client window (usually a CView or MDICLIENT).
      

  3.   

    void CMainFrame::OnViewLeft() 
    {
    // 显示隐藏侧边栏
    static BOOL bShow = TRUE; bShow = !bShow;

    if(bShow) // 显示
    {
    wndSplitter.SetColumnInfo( 0, m_nLeftWidth, 0 );
    }
    else
    {
    int cxMin;
    wndSplitter.GetColumnInfo(0, m_nLeftWidth, cxMin);
    wndSplitter.SetColumnInfo( 0, 0, 0 );
    }

    wndSplitter.RecalcLayout();
    }
      

  4.   

    各位的方法我已经试过了,
    wndSplitter.SetColumnInfo( 0, 0, 0 ); 效果不好,尤其那个拆分条,
    视图隐藏之后,拆分条也应该为不可见,  还望多多指教!!!