mydialog.cpp
来自「VC++6开发指南的源代码第7章-第11章」· C++ 代码 · 共 68 行
CPP
68 行
// MyDialog.cpp : implementation file
//
#include "stdafx.h"
#include "DlgDemo.h"
#include "MyDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// MyDialog dialog
MyDialog::MyDialog(CWnd* pParent /*=NULL*/)
: CDialog(MyDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(MyDialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void MyDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(MyDialog)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(MyDialog, CDialog)
//{{AFX_MSG_MAP(MyDialog)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// MyDialog message handlers
void MyDialog::OnButton1()
{
// TODO: Add your control notification handler code here
CDialog::OnOK();
}
void MyDialog::OnButton2()
{
// TODO: Add your control notification handler code here
CDialog::OnCancel();
}
void MyDialog::OnButton3()
{
// TODO: Add your control notification handler code here
int nRet = 5; // Just any value would do!
CDialog::EndDialog(nRet); // This value is returned by DoModal!
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?