在单文档程序里,我想将窗口分成下面这样
先分成2行1列,第1行再分为2列。代码如下,当总有错误,麻烦大家帮忙看一下,非常感谢!
if(m_pSplitter1.CreateStatic(this,2,1)==NULL)
return FALSE;
if(m_pSplitter2.CreateStatic(&m_pSplitter1,1,2,WS_CHILD|WS_VISIBLE,m_pSplitter1.IdFromRowCol(0,0))==NULL)
return FALSE;
m_pSplitter1.CreateView(1,0,RUNTIME_CLASS(CViewCtrlWnd),CSize(0,0),pContext);
m_pSplitter2.CreateView(0,0,RUNTIME_CLASS(CGCodeDrawView),CSize(0,0),pContext);
m_pSplitter2.CreateView(0,1,RUNTIME_CLASS(CGCodeCtrlWnd),CSize(0,0),pContext); m_pSplitter1.SetRowInfo(0,cy*2/3,10);
m_pSplitter1.SetRowInfo(1,cy/3,10);
m_pSplitter2.SetColumnInfo(0,cx*2/3,10);
m_pSplitter2.SetColumnInfo(1,cx/3,10);
m_pSplitter1.RecalcLayout();
m_pSplitter2.RecalcLayout();
先分成2行1列,第1行再分为2列。代码如下,当总有错误,麻烦大家帮忙看一下,非常感谢!
if(m_pSplitter1.CreateStatic(this,2,1)==NULL)
return FALSE;
if(m_pSplitter2.CreateStatic(&m_pSplitter1,1,2,WS_CHILD|WS_VISIBLE,m_pSplitter1.IdFromRowCol(0,0))==NULL)
return FALSE;
m_pSplitter1.CreateView(1,0,RUNTIME_CLASS(CViewCtrlWnd),CSize(0,0),pContext);
m_pSplitter2.CreateView(0,0,RUNTIME_CLASS(CGCodeDrawView),CSize(0,0),pContext);
m_pSplitter2.CreateView(0,1,RUNTIME_CLASS(CGCodeCtrlWnd),CSize(0,0),pContext); m_pSplitter1.SetRowInfo(0,cy*2/3,10);
m_pSplitter1.SetRowInfo(1,cy/3,10);
m_pSplitter2.SetColumnInfo(0,cx*2/3,10);
m_pSplitter2.SetColumnInfo(1,cx/3,10);
m_pSplitter1.RecalcLayout();
m_pSplitter2.RecalcLayout();
解决方案 »
- 如何将Double 数组用逗号分割,转成一个字符串
- 如何让cpropeytysheet在标签页太多时出现左右的小箭头?
- 一段windows游戏编程大师的代码,编译不过,帮我看下。
- 如何把Mapinfo数据做成GST文件?
- 【100分问题】请问如何模拟表单的提交过程
- 我在画图的时候用CDC类的Ellipse函数画同心圆,结果半径大的总会覆盖掉小的,有什么办法?(顺序是先画小圆后画大圆)
- CSting的小问题!
- 再问拟合Bezier曲线曲线的问题。
- 有什么方法可以在对话框上通过程序绘制表格?
- 注意::一个关于图形的,简单而又棘手的实际问题。。。
- MFC 下拉框可不可以变成上拉框或侧拉框的啊?
- 一个关于win32的问题
{
if(m_pSplitter1.CreateStatic(this,2,1)==NULL)
return FALSE;
if(m_pSplitter2.CreateStatic(&m_pSplitter1,1,2,WS_CHILD|WS_VISIBLE,m_pSplitter1.IdFromRowCol(0,0))==NULL)
return FALSE;
m_pSplitter1.CreateView(1,0,RUNTIME_CLASS(CViewCtrlWnd),CSize(0,0),pContext);
m_pSplitter2.CreateView(0,0,RUNTIME_CLASS(CGCodeDrawView),CSize(0,0),pContext);
m_pSplitter2.CreateView(0,1,RUNTIME_CLASS(CGCodeCtrlWnd),CSize(0,0),pContext);
bSplitterWnd = TRUE;
return TRUE;
}void CMainFrame::OnSize(...)// WM_SIZE消息响应函数
{
CFrameWnd::OnSize(...); if(bSplitterWnd)
{
m_pSplitter1.SetRowInfo(0,cy*2/3,10);
m_pSplitter1.SetRowInfo(1,cy/3,10);
m_pSplitter2.SetColumnInfo(0,cx*2/3,10);
m_pSplitter2.SetColumnInfo(1,cx/3,10); m_pSplitter1.RecalcLayout();
m_pSplitter2.RecalcLayout();
}
}