2008-10-15 61 views
2

在我的MFC程序中,我使用拆分器创建两个窗格。我现在想要再将这些窗格中的一个拆分成另一个窗口,并且换个角度来看,有人可以通过如何操作来指示我,还是指向某些代码的方向?拆分已拆分窗格(MFC)

我宁愿自己编写代码,所以我对自定义派生类不感兴趣,除非它们非常基本。

谢谢!

回答

3

CMainFrame::OnCreateClient

// Create splitter with 2 rows and 1 col 
m_wndSplitter.CreateStatic(this, 2, 1); 
// Create a view in the top row 
m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CView1), CSize(100, 100), pContext); 
// Create a 2 column splitter that will go in the bottom row of the first 
m_wndSplitter2.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD|WS_VISIBLE, m_wndSplitter.IdFromRowCol(1, 0)); 
// Create views for the bottom splitter 
m_wndSplitter2.CreateView(0, 0, RUNTIME_CLASS(CView2), CSize(100, 100), pContext); 
m_wndSplitter2.CreateView(0, 1, RUNTIME_CLASS(CView3), CSize(100, 100), pContext); 
... 
+0

该代码在运行时引发异常。 :( – Konrad 2008-10-15 13:37:30

0

我不是MFC方面的专家,但是难道你不能只在你用第一个分离器制作的窗格之一中放置一个分离器吗?我们在winform ....

+0

没有怎么做,最初的分裂在mainfrm完成和视图与窗格有关联。 – Konrad 2008-10-15 13:07:19