1.1.2.1.2 切换视图 更改视图的ID和风格就可以了。默认情况,自动创建的视图具有固定的ID和风格,例如框架自动创建的视图的ID总是AFX_IDW_PANE_FIRST,你可以以另外的ID来创建视图,然后再动态修改视图的ID为AFX_IDW_PANE_FIRST。参见知识库文章Q141334 VSWAP32 Demos Multiple-View Switching in SDI、Q141499 VWRPLC32 Replacing a View in a CMDIChildWnd和Q199515 SwSplit.exe Switches Splitter Pane Views in SDI App Window
pNewActiveView->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW, CFrameWnd::
rectDefault,this, viewID, &context);
这个参数:AFX_WS_DEFAULT_VIEW应该是指定window style的,可是我在msdn的windows style列表中并没有发现AFX_WS_DEFAULT_VIEW,您是怎样找到的?
原帖地址贴出来AFX_WS_DEFAULT_VIEW不是指定window style的
是这个View的ID
To: zhucde(【風間苍月】)(MS_MVP) 原贴的地址:http://community.csdn.net/Expert/topic/3102/3102098.xml?temp=.736706
默认的那个视图可以用CFrameWnd::CreateView来创建
http://community.csdn.net/Expert/topic/3102/3102098.xml?temp=.3944971相关的没有结贴的帖子还有:
http://community.csdn.net/Expert/topic/3105/3105250.xml?temp=.611355
http://community.csdn.net/Expert/topic/3104/3104712.xml?temp=.977627
蒋老大厉害,
我倒没有认真看.AFX_WS_ DEFAULT_VIEW 是默认风格,相当于:(WS_ VISIBLE | WS_CHILD | WS_BORDER)
更改视图的ID和风格就可以了。默认情况,自动创建的视图具有固定的ID和风格,例如框架自动创建的视图的ID总是AFX_IDW_PANE_FIRST,你可以以另外的ID来创建视图,然后再动态修改视图的ID为AFX_IDW_PANE_FIRST。参见知识库文章Q141334 VSWAP32 Demos Multiple-View Switching in SDI、Q141499 VWRPLC32 Replacing a View in a CMDIChildWnd和Q199515 SwSplit.exe Switches Splitter Pane Views in SDI App Window
多谢!!!