MFC拆分窗口的问题。急
我在原View下派生了5个类,分别为CTestView1~5,。拆分如下:BOOLCMainFrame::OnCreateClient(LPCREATESTRUCTlpc...
我在原View下派生了5个类,分别为CTestView1~5,。拆分如下:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: 在此添加专用代码和/或调用基类
CRect rect;
GetWindowRect(&rect);
//创建一个静态分栏窗口,分为3行1列
if(m_splitter1.CreateStatic(this,3,1)==NULL)
return FALSE;
//将CTestView1连接到0行0列窗格上
m_splitter1.CreateView(0,0,RUNTIME_CLASS(CTestView1),
CSize(rect.Width()/3,rect.Height()/3),pContext);
//将CTestView5类连接到2行0列窗格上
m_splitter1.CreateView(2,0,RUNTIME_CLASS(CTestView5),
CSize(rect.Width()/3,rect.Height()/3),pContext);
if(m_splitter2.CreateStatic(&m_splitter1,1,3,WS_CHILD|WS_VISIBLE,
m_splitter1.IdFromRowCol(1,0))==NULL)
return FALSE;//将第1行0列再分成1行3列
//将CTestView2类连接到第二个分栏对象的0行0列
m_splitter2.CreateView(0,0,RUNTIME_CLASS(CTestView2),
CSize(rect.Width()/3,rect.Height()/3),pContext);
//将CTestView3类连接到第二个分栏对象的0行1列
m_splitter2.CreateView(0,1,RUNTIME_CLASS(CTestView3),
CSize(rect.Width()/3,rect.Height()/3),pContext);
//将CTestView4类连接到第二个分栏对象的0行2列
m_splitter2.CreateView(0,2,RUNTIME_CLASS(CTestView4),
CSize(rect.Width()/3,rect.Height()/3),pContext);
return true;//CFrameWnd::OnCreateClient(lpcs, pContext);
但是拆分出来后。第二行(1行)特别小,几乎看不见。谁能教我下怎么改变第二行大小啊。谢啦 展开
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: 在此添加专用代码和/或调用基类
CRect rect;
GetWindowRect(&rect);
//创建一个静态分栏窗口,分为3行1列
if(m_splitter1.CreateStatic(this,3,1)==NULL)
return FALSE;
//将CTestView1连接到0行0列窗格上
m_splitter1.CreateView(0,0,RUNTIME_CLASS(CTestView1),
CSize(rect.Width()/3,rect.Height()/3),pContext);
//将CTestView5类连接到2行0列窗格上
m_splitter1.CreateView(2,0,RUNTIME_CLASS(CTestView5),
CSize(rect.Width()/3,rect.Height()/3),pContext);
if(m_splitter2.CreateStatic(&m_splitter1,1,3,WS_CHILD|WS_VISIBLE,
m_splitter1.IdFromRowCol(1,0))==NULL)
return FALSE;//将第1行0列再分成1行3列
//将CTestView2类连接到第二个分栏对象的0行0列
m_splitter2.CreateView(0,0,RUNTIME_CLASS(CTestView2),
CSize(rect.Width()/3,rect.Height()/3),pContext);
//将CTestView3类连接到第二个分栏对象的0行1列
m_splitter2.CreateView(0,1,RUNTIME_CLASS(CTestView3),
CSize(rect.Width()/3,rect.Height()/3),pContext);
//将CTestView4类连接到第二个分栏对象的0行2列
m_splitter2.CreateView(0,2,RUNTIME_CLASS(CTestView4),
CSize(rect.Width()/3,rect.Height()/3),pContext);
return true;//CFrameWnd::OnCreateClient(lpcs, pContext);
但是拆分出来后。第二行(1行)特别小,几乎看不见。谁能教我下怎么改变第二行大小啊。谢啦 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询