15,979
社区成员
发帖
与我相关
我的任务
分享
我使用CxSplitterWnd的部分代码OnInitDialog():
CCreateContext context1;
context1.m_pNewViewClass = RUNTIME_CLASS(CMyDialog1);
context1.m_pCurrentDoc = NULL;
context1.m_pNewDocTemplate = NULL;
context1.m_pLastView = NULL;
context1.m_pCurrentFrame = NULL;
CCreateContext context2;
context2.m_pNewViewClass = RUNTIME_CLASS(CMyDialog2);
context2.m_pCurrentDoc = NULL;
context2.m_pNewDocTemplate = NULL;
context2.m_pLastView = NULL;
context2.m_pCurrentFrame = NULL;
CCreateContext context3;
context3.m_pNewViewClass = RUNTIME_CLASS(CMyDialog3);
context3.m_pCurrentDoc = NULL;
context3.m_pNewDocTemplate = NULL;
context3.m_pLastView = NULL;
context3.m_pCurrentFrame = NULL;
CWnd * pWnd = NULL;
pWnd = this;
CRect rect;
pWnd->GetClientRect(&rect);
m_splitter.CreateStatic(pWnd,2,1);
m_splitter.CreateView( 0, 0, RUNTIME_CLASS( CMyDialog1 ), CSize( 0, rect.Height()/2 ), &context1 );
m_splitter.CreateView( 1, 0, RUNTIME_CLASS( CMyDialog2 ), CSize( 0, rect.Height()/2 ), &context2 );
//m_splitter.MoveWindow(&rect);//出错