MFC 分隔框制作步骤
2013-03-29 09:23
197 查看
1 创建单文档
2 在父框架类中定义一个CSplitterWnd类型的成员对象。
3 创建一个基于CFormView对话框类,CDialogShow。(注意:把对话框的style设置为Child,否则你就等则界面崩溃吧)
4 重载父框架类的CFrameWnd::OnCreateClient成员函数。
5 在重载的CFrameWnd::OnCreateClient函数中调用CSplitterWnd成员对象的Create函数。
函数示例如下:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
if(m_splitter.CreateStatic(this,1,2)==NULL)
return FALSE;
CRect rect;
GetClientRect(rect);
m_splitter.CreateView(0, 0, RUNTIME_CLASS(CDialogShow), CSize(rect.Width()/5, 0), pContext);
m_splitter.CreateView(0, 1, RUNTIME_CLASS(CNurbsView), CSize(0, 0), pContext);
return TRUE;
}
如果编译出现:error C2143: syntax error : missing ';' before '*'
需要在C***View类前添加:class C***Doc;
代码下载:http://download.csdn.net/detail/kcpnevergiveup/5194247
2 在父框架类中定义一个CSplitterWnd类型的成员对象。
3 创建一个基于CFormView对话框类,CDialogShow。(注意:把对话框的style设置为Child,否则你就等则界面崩溃吧)
4 重载父框架类的CFrameWnd::OnCreateClient成员函数。
5 在重载的CFrameWnd::OnCreateClient函数中调用CSplitterWnd成员对象的Create函数。
函数示例如下:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
if(m_splitter.CreateStatic(this,1,2)==NULL)
return FALSE;
CRect rect;
GetClientRect(rect);
m_splitter.CreateView(0, 0, RUNTIME_CLASS(CDialogShow), CSize(rect.Width()/5, 0), pContext);
m_splitter.CreateView(0, 1, RUNTIME_CLASS(CNurbsView), CSize(0, 0), pContext);
return TRUE;
}
如果编译出现:error C2143: syntax error : missing ';' before '*'
需要在C***View类前添加:class C***Doc;
代码下载:http://download.csdn.net/detail/kcpnevergiveup/5194247
相关文章推荐
- MFC动态链接库的制作步骤和使用方法
- MFC动态链接库的制作步骤和使用方法
- 使用MFC创建一个分隔的窗口的步骤
- MFC动态链接库的制作步骤和使用方法
- 分享 使用普通笔记本电脑,DIY制作合成混音MTV视频,并上传分享的步骤
- JAVA JNLP组件数字签名制作步骤
- 新手上路003~~系统硬件磁盘的概念,磁盘分区,制作LVM逻辑卷(新手的详细步骤)~~
- MFC制作双缓冲无闪烁的字幕滚动条
- 项目的具体开发制作步骤
- MFC中制作一个似命令行的输入框
- MFC制作程序界面锁定 .
- MFC Http Post请求步骤
- MFC基于对话框的简单步骤
- 一个MFC制作的跑酷游戏的小Demo
- MFC应用程序中处理消息的顺序以及对话框关闭步骤
- (4)qt5制作简易计算器详细步骤(ui界面)
- MFC之“图种生成器制作”笔记(二)
- 在线网络投票活动实施步骤及疑难问题汇编[制作中...]
- PyQt5简单小工具制作步骤:
- 制作rpm包步骤