拆分已拆分的窗格(MFC)

时间:2008-10-15 12:50:50

标签: c++ mfc views splitter

在我的MFC程序中,我使用分割器创建两个窗格。我现在想把这些窗格中的一个再分成两半并放入另一个视图,有人可以告诉我如何做或者指向一些代码的方向吗?

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

谢谢!

2 个答案:

答案 0 :(得分:4)

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);
...

答案 1 :(得分:0)

我不是MFC的专家,但是你不能把分离器放在你用第一个分离器制作的一个窗格中吗?我们如何做winform ....