切分窗口后怎么再重新连接到视图
我在SDI中将窗口切分为3部分:
````````````````````````````
1 ` 2 `
` `
```````````````````
` 3 `
` `
````````````````````````````
1为TreeView,2、3为FormView。
我要点击1,在3中显示不同类型的内容,所以要将视图3更换为另外的视图4或5。
我这样实现:
CCreateContext context;
CDocument* pDoc = ((CView*)m_wndSplitterH.GetPane(1, 0))-> GetDocument();
CView* pOldView = (CView*)m_wndSplitterH.GetPane(1, 0);//m_wndSplitterH为
//水平的splitterbar
pOldView-> DestroyWindow();
CView* pNewActiveView = pNewActiveView = (CView*)GetDlgItem(IDD_FORM4);
if (NULL == pNewActiveView)
pNewActiveView = (CView*)new CForm4View;
[解决办法]
http://www.vckbase.com/code/winview/splitter/switchviews_in_splitter.zip