注册 登录
编程论坛 VC.NET论坛

谁能解决我的拆分窗口的问题

haitao9999 发布于 2010-01-09 17:47, 2132 次点击
我的拆分窗口设计为|型,即总体分两行,上边一行分两列。代码如下,运行的时候出现问题是,下面的视几乎顶上软件工具栏了,虽然实现了拆分并可拖动,可怎么能改变初始位置呢。请高手指教。

BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: 在此添加专用代码和/或调用基类
CRect rect;
GetClientRect(&rect);
CSize lSize = CSize(rect.Width()/4,rect.Height()*2/3);
CSize rSize = CSize(rect.Width()*3/4,rect.Height()*2/3);
CSize blSize = CSize(rect.Width(),rect.Height()/3);
if(m_wndSplitter.CreateStatic(this,2,1)==NULL)
    return FALSE;
m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(CBelowView),blSize,pContext);
if(m_wndSplitter2.CreateStatic(&m_wndSplitter,1,2,
  WS_CHILD|WS_VISIBLE,m_wndSplitter.IdFromRowCol(0, 0))==NULL)
return FALSE;
m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS(CLeftView),lSize, pContext);
m_wndSplitter2.CreateView(0,1,RUNTIME_CLASS(CRightView),rSize,pContext);


return TRUE;
}
0 回复
1