参考VC++6.0  开发指南

使用类:CSplitterWnd

 CSplitterWnd分割窗口有两种方式,动态分割和静态分割

动态分割:最多可以有2×2个子窗口,所有窗格使用同一个View类;

静态分割:最多16×16个,每个窗格使用不同的View类

 

CSplitterWnd使用方法:

一、首先,需要在CMainFrame中创建一CSplitterWnd对象,

     CSplitterWnd m_wndSplitter;

     同时,需要重载OnCreateClient()函数,如下

CMainFrame.h中声明:

public:
    BOOL OnCreateClient(LPCREATESTRUCT lpcs,CCreateContext * pContext);

CMainFrame.cpp中实现:   (动态分割/静态分割  根据任选其一)

BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs,CCreateContext * pContext)
{
    //静态分割窗口 
    BOOL bCreateSplit=m_wndSplitter.CreateStatic(this,2,1);
    m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CView1),CSize(0,0),pContext);
    m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(CView2),CSize(0,0),pContext);
    return bCreateSplit;

    //动态分割窗口
    return m_wndSplitter.Create(this,2,2,CSize(10,10),pContext);
}   

 

问题:

      CCreateClient由谁调用?

 

 

相关文章:

  • 2021-07-08
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2021-07-08
  • 2021-09-01
  • 2022-01-22
猜你喜欢
  • 2022-12-23
  • 2021-12-17
  • 2021-07-26
  • 2021-12-11
  • 2021-08-22
  • 2021-08-25
  • 2021-09-14
相关资源
相似解决方案