你的意思是在OnSize函数里添加分割窗口的代码?每次改变边框大小产生WM_SIZE消息,相应OnSize函数,重新分割窗口?
我试了试,编译没问题,但是运行不了
我是这样理解的:
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CRect rcClient(0, 0, 0, 0);
GetClientRect(rcClient);
Up.cx=rcClient.Width();
Up.cy=rcClient.Height()*5/6;
Down.cx=rcClient.Width();
Down.cy=rcClient.Height()*1/6;
CCreateContext context;
CDocument *pDoc = GetActiveView()->GetDocument();
context.m_pCurrentDoc=pDoc;
if(m_wndSplitter.CreateStatic(this,2,1)==NULL)
return;
m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CMyWorkView),Up,&context);
m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(COperateView),Down,&context);
}
[此贴子已经被作者于2006-10-9 12:56:34编辑过]
生活充满阳光,快乐无处不在