标题:MFC窗口分割问题
取消只看楼主
恶魔_铃铛
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2012-10-28
结帖率:0
已结贴  问题点数:10 回复次数:0 
MFC窗口分割问题
以下是我重载的oncreateclient函数,
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
   
    CRect cr;  GetWindowRect(&cr);
if(m_splitter.CreateStatic(this,1,2)==NULL)
        return FALSE;
if(m_splitter2.CreateStatic(&m_splitter,2,1,WS_CHILD|WS_VISIBLE,
        m_splitter.IdFromRowCol(0, 0))==NULL)
        return FALSE;
 m_splitter2.CreateView(0,0,RUNTIME_CLASS(Formview1),CSize(cr.Width()/2, cr.Height()/2),pContext);
 m_splitter2.CreateView(1,0,RUNTIME_CLASS(Formview2),CSize(cr.Width()/2, cr.Height()/2),pContext);
  if(m_splitter1.CreateStatic(&m_splitter,2,1,WS_CHILD|WS_VISIBLE,
        m_splitter.IdFromRowCol(0, 1))==NULL)
        return FALSE;
    m_splitter1.CreateView(0,0,RUNTIME_CLASS(Formview3),CSize(cr.Width()/2, cr.Height()/2),pContext);
   m_splitter1.CreateView(1,0,RUNTIME_CLASS(Formview4),CSize(cr.Width()/2, cr.Height()/2),pContext);
     return TRUE;
}
其中Formview1,2,3,4是我的几个继承CFORMVIEW的对话框类,m_splitter,1,2是CSplitterWnd对象,现在出现的问题是
左边的分割窗格老是靠着最左边如图所示,而且各窗口大小并非如cr.Width()/2, cr.Height()/2设置的这样,求大神解读。。。
附件是结果的截图。。。。
搜索更多相关主题的帖子: 分割 return 
2012-12-14 16:26



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-391258-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.127232 second(s), 9 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved