MFC对单文档进行窗口分割。
2016-02-25 13:53
302 查看
新建单文档工程,在MainFrm.cpp中添加虚函数OnCreateClicent();
1、在虚函数中添加代码:
2、在头文件MainFrm.h中添加:
// 特性
public:
CSplitterWnd m_wndSplitter;
1、在虚函数中添加代码:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { // TODO: 在此添加专用代码和/或调用基类 CRect rect; GetClientRect(&rect); m_wndSplitter.CreateStatic(this,1,2);//静态分割<span style="white-space:pre"> </span> int cx = max(10,(rect.Width()-50))/2; int cy = rect.Height(); m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CSwitchFormView),CSize(cx,cy),pContext)//第一视图类View m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CLastFormView),CSize(cx,cy),pContext);//第二视图类View</span> return TRUE; //return CFrameWndEx::OnCreateClient(lpcs, pContext); }</span>
2、在头文件MainFrm.h中添加:
// 特性
public:
CSplitterWnd m_wndSplitter;
相关文章推荐
- IDE、SATA、SCSI、SAS、FC、SSD硬盘类型介绍
- Android 内存 - 获取单个应用内存限制
- SQL Server 视图创建点滴
- Android仿QQ和iOS的ListView左滑出现删除和置顶等操作,可自定义菜单
- .Net网站架构设计(四) 缓存技术
- Oracle dblink详解
- 【云计算】marathon集群如何升级?
- iOS开发那些事--性能优化–内存泄露问题的解决
- 主线程等待子线程运行完之后再运行
- curl http_code 状态码 意义及信息
- ubuntu 创建用户
- Jquery方法
- 基于mtk平台调试FM发射芯片KT0805
- Java基础08 继承
- Memcached简介
- 神奇的 collectionview
- oracle创建表
- 探究android:largeHeap
- Java基础:Day14笔记内容 ( StringBuilder类)
- poj 3468 A Simple Problem with Integers(线段树区间更新)