如何在一个SDI文档中分割出三个窗口?能否给出具体的代码?

解决方案 »

  1.   

    http://www.vckbase.com/document/viewdoc/?id=192
      

  2.   

    MainFrame.h中添加CreateClient虚函数:
    主要代码
    Splitter.CreateStatic(this,1,3);//将主窗口分割成左中右三个窗口
    //以下这些View你首先要建立好
    Splitter.CreateView(0, 0, RUNTIME_CLASS(CFirstView), CSize(0,0), pContext);
    Splitter.CreateView(0, 1, RUNTIME_CLASS(CSecondView), CSize(0,0), pContext);
    Splitter.CreateView(0, 1, RUNTIME_CLASS(CThirdView), CSize(0,0), pContext);...
      

  3.   

    if(m_MySplitter1.CreateStatic(this,2,1) == FALSE)   
    return   FALSE;   
    CRect   rect;   
    this->GetClientRect(&rect);  
    if(this->m_MySplitter2.CreateStatic(&m_MySplitter1,1,2,WS_CHILD|WS_VISIBLE,m_MySplitter1.IdFromRowCol(0,0))== NULL)
    return   FALSE;  
    this->m_MySplitter2.CreateView(0,0,RUNTIME_CLASS(Tree),CSize((int)(rect.Width()*1/6),rect.Height()*5/6),pContext); 
    this->m_MySplitter2.CreateView(0,1,RUNTIME_CLASS(ListData),CSize((int)(rect.Width()*5/6),rect.Height()*5/6),pContext);   
    this->m_MySplitter1.CreateView(1,0,RUNTIME_CLASS(DhXs),CSize((int)(rect.Width()),rect.Height()*1/6),pContext);   用以上代码时为什么不能显示出上面的窗口,只能显示下面的窗口.
      

  4.   

    候捷《深入浅出MFC》 书上有 ,要多看书啊 ,兄台
      

  5.   

    ....直接在创建的时候第3步的时候 选ADVANCED 然后在FILE EXTENSION中写入名称,在windows styles属性页中选中use split windows 其他默认,最后一步选择基类为cscrollview,然后手动增加两个VIEW类。修改CMAINFRAM:ONCREATEClient,填加 m_wndSplitter.CreateStatic(this,1,2);
    m_wndsplitter.CreateCView(0,0,RUNTIME_CLASS(CYourview1),Csize(200,0),pContext);
    m_wndsplitter.CreateView(0,0,RUNTIME_CLASS(CYourview2),Csize(0,0),pContext);
    return true