mfc中dialog中嵌入view
2012-10-09 10:15
134 查看
在dialog::OnInitDialog中加入
CWnd* pFrameWnd = this;
CCreateContext pContext;
pContext.m_pCurrentDoc = 0;//new CTest_simpleDoc;
pContext.m_pNewViewClass = RUNTIME_CLASS(C2); //C2view类
C2* pView = (C2*)((CFrameWnd*)pFrameWnd)->CreateView(&pContext);
pView->ShowWindow(SW_NORMAL);
CRect rectWindow;
GetClientRect(&rectWindow);
pView->MoveWindow(rectWindow);
CSize sizeTotal;
sizeTotal.cx = sizeTotal.cy = 1000;
pView->SetScrollSizes(MM_TEXT, sizeTotal);
类似的代码。
再在CView派生类里面处理下面消息
int C2::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
{
return MA_ACTIVATE;//CScrollView::OnMouseActivate(pDesktopWnd,nHitTest, message);
}
CWnd* pFrameWnd = this;
CCreateContext pContext;
pContext.m_pCurrentDoc = 0;//new CTest_simpleDoc;
pContext.m_pNewViewClass = RUNTIME_CLASS(C2); //C2view类
C2* pView = (C2*)((CFrameWnd*)pFrameWnd)->CreateView(&pContext);
pView->ShowWindow(SW_NORMAL);
CRect rectWindow;
GetClientRect(&rectWindow);
pView->MoveWindow(rectWindow);
CSize sizeTotal;
sizeTotal.cx = sizeTotal.cy = 1000;
pView->SetScrollSizes(MM_TEXT, sizeTotal);
类似的代码。
再在CView派生类里面处理下面消息
int C2::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
{
return MA_ACTIVATE;//CScrollView::OnMouseActivate(pDesktopWnd,nHitTest, message);
}
相关文章推荐
- LibreOffice-SDK 开发实战:嵌入MFC-View 和 C# Winform
- 把dialog嵌入到FormView的注意事项
- MFC对话框(Dialog类)中添加客户区(View类)实现绘图
- SThtmlDialog例子,MFC嵌入HTML控件的方法
- 在Dialog中嵌入View的方法
- [转]LibreOffice-SDK 开发实战:嵌入MFC-View 和 C# Winform
- 在Dialog中嵌入View的方法
- 在Dialog中嵌入View的方法
- 用VS调试嵌入在MFC程序里的WPF View代码
- Create a View in a MFC Dialog
- 在Dialog中嵌入View的方法
- 关于MFC中CDHtmlDialog嵌入flash和调用JS一些技术总结
- Designing ActiveX Components with the MFC Document/View Model
- MFC 刷新View的背景颜色
- 将Cocos2dx 3.4 嵌入到MFC中
- Android 改变AlertDialog中View字体的大小
- mfc不同解决方案之间拷贝dialog资源
- Creating your first MFC Doc/View application
- VC6 MFC中ClassView视图中无法显示某个类的问题
- Android版百度地图MapView维护(dialog中放一个MapView)