关于嵌套拆分窗口。

lybapple 2003-08-23 10:04:16
在CMainFrame定义
CSplitterWnd m_sp1,m_sp2,m_sp3;
然后再

if(
!m_sp1.CreateStatic(this,1,2)||
!m_sp1.CreateView(0,1,RUNTIME_CLASS(CConnectionView),CSize(0,0),pContext)||

!m_sp2.CreateStatic(&m_sp1,2,1,WS_CHILD|WS_VISIBLE)||
!m_sp2.CreateView(1,0,RUNTIME_CLASS(CSendView),CSize(0,0),pContext)||

!m_sp3.CreateStatic(&m_sp2,1,2,WS_CHILD|WS_VISIBLE)||
!m_sp3.CreateView(0,0,RUNTIME_CLASS(CChatView),CSize(350,0),pContext)||
!m_sp3.CreateView(0,1,RUNTIME_CLASS(CDrawView),CSize(0,0),pContext)
)
return FALSE;
CRect rect;
this->GetClientRect( &rect );

m_sp1.SetColumnInfo(0, rect.Width()/2*3, 10);
m_sp1.SetColumnInfo(1, rect.Width()/1*3, 10);
m_sp1.RecalcLayout();

m_sp2.SetRowInfo(0, rect.Height()/3*4, 10);
m_sp2.SetRowInfo(1, rect.Height()/1*4, 10);
m_sp2.RecalcLayout();

SetActiveView((CView*)m_sp2.GetPane(1,0));
return TRUE;
...全文
51 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhusunme 2003-09-06
  • 打赏
  • 举报
回复
你是白吃啊。
那里
m_sp1.SetColumnInfo(0, rect.Width()/2*3, 10);
应该是
m_sp1.SetColumnInfo(0, rect.Width()*2/3, 10);
lybapple 2003-09-06
  • 打赏
  • 举报
回复
解决了。
heavenchang 2003-08-28
  • 打赏
  • 举报
回复
代码调度没有报错?
那不就是拆分计算不对?


lybapple 2003-08-23
  • 打赏
  • 举报
回复
上面那段写在
BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
可是在分好窗口后,大小不能调整好,为什么??
下面是理想的窗口大小。
.......................
| | | |
| | | |
...............| |
| | |
........................
heavenchang 2003-08-23
  • 打赏
  • 举报
回复
你问什么呀

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧