CRect rect;
GetClientRect(&rect); if(wndSplitter_erect1.CreateStatic(this,1,2)==NULL)
return FALSE; wndSplitter_erect1.CreateView(0,1,RUNTIME_CLASS(CMsmonitorDownView),CSize(rect.Width()/6,rect.Height()),pContext);
if(wndSplitter_horizontal1.CreateStatic(&wndSplitter_erect1,2,1,WS_CHILD|WS_VISIBLE, wndSplitter_erect1.IdFromRowCol(0, 0))==NULL)
return FALSE; wndSplitter_horizontal1.CreateView(0,0,RUNTIME_CLASS(CMsmonitorUpView),CSize(rect.Width()-rect.Width()/6,rect.Height()/3),pContext); wndSplitter_horizontal1.CreateView(1,0,RUNTIME_CLASS(CMsmonitorTreeView),CSize(rect.Width()-rect.Width()/6,rect.Height()-rect.Height()/3),pContext);
有两个问题:
1、为什么我的CSize()里设置的初始大小不起作用了呢?
2、有人说要用m_wndSplitter1.SetColumnInfo再设置一下大小,我不明白的是,已经CSize指定了大小,为什么还要再设置一遍呢?
wndSplitter_erect1.SetColumnInfo(0, rect.Width()-rect.Width()/6, 0);
视图是镶嵌在框架里的,这个跟网页的概念差不多.
如果试图的大小大于框驾的时候,可以显示滚动条.