📄 设置不同的返回值来关闭对话框.txt
字号:
// MyWnd.cpp
#include "MyDialog.h"
void CMyWnd::ShowDialog()
{
CMyDialog myDlg;
int nRet = myDlg.DoModal();
if ( nRet == IDOK || nRet == 5 )
AfxMessageBox("Dialog closed successfully");
}
// MyDialog.cpp
void CMyDialog::OnSomeAction()
{
// Do something.
int nRet = 5; // Any value will do.
EndDialog(nRet); // This value is returned by DoModal.
// Do something.
return; // Dialog closed and DoModal returns only here.
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -