自己想了很久都不知道是什么原因,只有向大家求助了。
我用VC6新建的SDI程序。BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext *pContext)
{
m_wndSplitter1.CreateStatic(this,1,2);
m_wndSplitter2.CreateStatic(&m_wndSplitter1,2,1,WS_CHILD|WS_VISIBLE|WS_BORDER,
m_wndSplitter1.IdFromRowCol(0, 0)); m_wndSplitter2.CreateView(0,0,
RUNTIME_CLASS(CMyView), CSize(200, 100), pContext);
m_wndSplitter2.CreateView(1,0,
RUNTIME_CLASS(CMyView), CSize(200, 100), pContext);
m_wndSplitter1.CreateView(0,1,
RUNTIME_CLASS(CMyView), CSize(100, 100), pContext); CRect rect;
this->GetClientRect(&rect); m_wndSplitter1.SetRowInfo(0,rect.Width()/2,100); m_wndSplitter2.SetColumnInfo(0,rect.Height()/2,100);
m_wndSplitter2.SetRowInfo(0,rect.Width()/2,100);
m_wndSplitter2.SetRowInfo(1,rect.Width()/2,100);
m_wndSplitter1.RecalcLayout();
m_wndSplitter2.RecalcLayout(); SetActiveView((CMyView*)m_wndSplitterV.GetPane(0,0));
return TRUE;
}理想的窗口形状是这个样子:┌───┬────────┐
│ │ │
│ │ │
├───┤ │
│ │ │
│ │ │
│ │ │
└───┴────────┘结果以上代码确是这个样子:┌┬───────────┐
││ │
││ │
├┤ │
││ │
││ │
││ │
└┴───────────┘前面(0,0)里的两个view的宽度几乎为0,怎么设置都不行,向大家请教解决办法!
我用VC6新建的SDI程序。BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext *pContext)
{
m_wndSplitter1.CreateStatic(this,1,2);
m_wndSplitter2.CreateStatic(&m_wndSplitter1,2,1,WS_CHILD|WS_VISIBLE|WS_BORDER,
m_wndSplitter1.IdFromRowCol(0, 0)); m_wndSplitter2.CreateView(0,0,
RUNTIME_CLASS(CMyView), CSize(200, 100), pContext);
m_wndSplitter2.CreateView(1,0,
RUNTIME_CLASS(CMyView), CSize(200, 100), pContext);
m_wndSplitter1.CreateView(0,1,
RUNTIME_CLASS(CMyView), CSize(100, 100), pContext); CRect rect;
this->GetClientRect(&rect); m_wndSplitter1.SetRowInfo(0,rect.Width()/2,100); m_wndSplitter2.SetColumnInfo(0,rect.Height()/2,100);
m_wndSplitter2.SetRowInfo(0,rect.Width()/2,100);
m_wndSplitter2.SetRowInfo(1,rect.Width()/2,100);
m_wndSplitter1.RecalcLayout();
m_wndSplitter2.RecalcLayout(); SetActiveView((CMyView*)m_wndSplitterV.GetPane(0,0));
return TRUE;
}理想的窗口形状是这个样子:┌───┬────────┐
│ │ │
│ │ │
├───┤ │
│ │ │
│ │ │
│ │ │
└───┴────────┘结果以上代码确是这个样子:┌┬───────────┐
││ │
││ │
├┤ │
││ │
││ │
││ │
└┴───────────┘前面(0,0)里的两个view的宽度几乎为0,怎么设置都不行,向大家请教解决办法!
这句话可以设置左边的宽度!