BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { // TODO: Add your specialized code here and/or call the base class RECT rect; GetClientRect(&rect); CString str; int m_y=rect.bottom-rect.top; int m_x=rect.right-rect.left; if (!m_wndSplitter1.CreateStatic(this,1,2)) { TRACE(_T("failed to create the splitter")); return FALSE; } if (!m_wndSplitter1.CreateView(0,1,RUNTIME_CLASS(COptionView),CSize(m_x-640,m_y),pContext)) { TRACE(_T("Failed to create view in first pane")); return FALSE; } m_OptionView=(COptionView*)m_wndSplitter1.GetPane( 0,1); if(!m_wndSplitter2.CreateStatic(&m_wndSplitter1,2,1,WS_CHILD|WS_VISIBLE, m_wndSplitter1.IdFromRowCol(0, 0))) { TRACE(_T("failed to create view in second pane")); return FALSE; } m_wndSplitter1.SetColumnInfo(0,640,200); if (!m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS(CTestView),CSize(640,480),pContext)) { TRACE(_T("Failed to create view in first pane")); return FALSE; }if (!m_wndSplitter2.CreateView(1,0,RUNTIME_CLASS(CInfView),CSize(640,m_y-480),pContext)) { TRACE(_T("Failed to create view in first pane")); return FALSE; } m_TestView=(CTestView*)m_wndSplitter2.GetPane(0,0); m_InfView=(CInfView*)m_wndSplitter2.GetPane(1,0);}================================ m_wndSplitter1 m_wndSplitter2 自己定义这是原来我做的
这是什么东西
这个控件是什么,切分窗口吗??
{
// TODO: Add your specialized code here and/or call the base class
RECT rect;
GetClientRect(&rect);
CString str;
int m_y=rect.bottom-rect.top;
int m_x=rect.right-rect.left; if (!m_wndSplitter1.CreateStatic(this,1,2))
{
TRACE(_T("failed to create the splitter"));
return FALSE;
}
if (!m_wndSplitter1.CreateView(0,1,RUNTIME_CLASS(COptionView),CSize(m_x-640,m_y),pContext))
{
TRACE(_T("Failed to create view in first pane"));
return FALSE;
}
m_OptionView=(COptionView*)m_wndSplitter1.GetPane( 0,1); if(!m_wndSplitter2.CreateStatic(&m_wndSplitter1,2,1,WS_CHILD|WS_VISIBLE, m_wndSplitter1.IdFromRowCol(0, 0)))
{
TRACE(_T("failed to create view in second pane"));
return FALSE;
}
m_wndSplitter1.SetColumnInfo(0,640,200);
if (!m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS(CTestView),CSize(640,480),pContext))
{
TRACE(_T("Failed to create view in first pane"));
return FALSE;
}if (!m_wndSplitter2.CreateView(1,0,RUNTIME_CLASS(CInfView),CSize(640,m_y-480),pContext))
{
TRACE(_T("Failed to create view in first pane"));
return FALSE;
}
m_TestView=(CTestView*)m_wndSplitter2.GetPane(0,0);
m_InfView=(CInfView*)m_wndSplitter2.GetPane(1,0);}================================
m_wndSplitter1
m_wndSplitter2
自己定义这是原来我做的
其次用SDK也是可以滴,就是创建一个子窗口,响应鼠标消息,改变其它窗口的位置和大小,发挥想象力,编程无所不能。