再探MFC(四)创建对话框
来源:互联网 发布:关于json的面试题 编辑:程序博客网 时间:2024/06/05 05:07
以点击菜单弹出非模式对话框为例.
step1
资源视图添加对话框模板.重命名对话框资源ID.
step2
选中对话框,右键菜单点击添加类.
step3
在菜单项的消息处理函数中
CDialogAddContactdlg;
INT_PTR nResponse =dlg.DoModal();
if (nResponse ==IDOK)
{
}
else if (nResponse== IDCANCEL)
{
}
可以通过DoModel创建模式对话框,通过Create创建非模式对话框.Remarks解释了两种对话框类型.Dialog boxes are of two types: modal andmodeless. A modal dialog box must be closed by the user before the applicationcontinues. A modeless dialog box allows the user to display the dialog box andreturn to another task without canceling or removing the dialog box.
如何关闭对话框?Remarks介绍如下.
A modal dialog boxcloses automatically when the user presses the OK or Cancel buttons or whenyour code calls the EndDialog member function.
When you implement amodeless dialog box, always override the OnCancel member function and callDestroyWindow from within it. Don't call the base class CDialog::OnCancel,because it calls EndDialog, which will make the dialog box invisible but willnot destroy it. You should also override PostNcDestroy for modeless dialogboxes in order to delete this, since modeless dialog boxes are usuallyallocated with new. Modal dialog boxes are usually constructed on the frame anddo not need PostNcDestroy cleanup.
https://msdn.microsoft.com/en-us/library/132s802t.aspx
- 再探MFC(四)创建对话框
- C++ MFC / VS2013 之四 对话框:(创建对话框模板和修改对话框属性)
- MFC 创建非模态对话框
- MFC创建非模态对话框
- MFC 创建字体对话框
- MFC对话框工程创建
- MFC 子对话框创建
- MFC创建模式对话框
- MFC---创建对话框
- 创建MFC对话框
- MFC创建对话框
- <MFC>创建对话框和新建对话框类
- MFC创建主对话框为非模态对话框
- MFC 静态对话框的创建
- API和MFC创建对话框
- MFC创建模态对话框
- MFC创建一个非模态对话框
- MFC创建椭圆形半透明对话框
- android获取文件getMimeType的两种方法
- 【C/C++学院】0723-32位与64位/调戏窗口程序/数据分离算法/内存检索/二分查找法/myVC
- jquery插件网站--我常用的
- Python 核心编程第六章练习
- 观察者模式(监听器模式)
- 再探MFC(四)创建对话框
- 使用Selenium来抓取动态加载的页面
- *p++与(*p)++与*(p++)
- Hibernate--clear(),flush(),evict()
- HDU2255 奔小康赚大钱【二分图最佳匹配】
- java 对象池
- 【Linux】Linux Maven配置
- MSBuild.exe 编译
- 未授权用户在此计算机上的请求登录类型