使用CSplitterWnd切分窗口,但是大小总是不对.什么原因呢?(附工程源码)
azhen 2007-11-05 03:58:17 现在在学校做一个项目,使用了CSplitterWnd类,我想做的事情很简单,就是把一个view分成上下两个窗口,上面的高度为 窗口高度Height()*9/10,下面的为Height()*/10,但是我得到的界面里,上下两个窗口的高度总是不能符合这个比例,附件有工程文件,VC 6.0的,谢谢!
这是主要的代码:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
CRect cr;
GetWindowRect( &cr );
// 分成两行一列
m_splitter.CreateStatic(this, 2, 1 ) ;
//第一行的高度为.Height()*9/10 ,而第二行为.Height()/10
m_splitter.CreateView( 0, 0, RUNTIME_CLASS(CSplitterWindowView),
CSize(cr.Width(), cr.Height()*9/10), pContext);
m_splitter.CreateView( 1, 0, RUNTIME_CLASS(CFormViewDown),
CSize(cr.Width(), cr.Height()/10), pContext );
m_splitter.RecalcLayout();
return TRUE;
}
请达人们指点迷津....谢谢!