VC单文档切分动态更换多视图问题
我建立一个基于CFORMVIEW的单文档MFC程序,把工作去切分成3块,我现在要动态更换某一块的表单,该怎么做,最好给出详细步骤!
这是我的切分函数:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
BOOL bRes=sp1.CreateStatic(this,2,1);
sp1.CreateView(0,0,RUNTIME_CLASS(CtestView),CSize
(0,0),pContext);
sp2.CreateStatic(&sp1,1,2,WS_CHILD|WS_VISIBLE,sp1.IdFromRowCol
(1,0));
sp2.CreateView(0,0,RUNTIME_CLASS(testform10),CSize
(0,0),pContext);
sp2.CreateView(0,1,RUNTIME_CLASS(testform11),CSize
(0,0),pContext);
sp2.SetColumnInfo(0,200,0);
sp1.SetRowInfo(0,150,0);
//sp1.RecalcLayout();
//sp2.RecalcLayout();
return bRes;
}
在网上找得转换函数:
void CMainFrame::OnSwitchView1(void)
{
sp2.DeleteView(0,1);
sp2.CreateView(0, 1,RUNTIME_CLASS(testform112), CSize(0, 0),NULL);
sp2.RecalcLayout();
}
可我不知道怎么用,谢谢,尽量给点详细的指导!
[解决办法]
解决了?恭喜
[解决办法]
直接在View里面操作不就行了吗!!