buttondialog.cpp
来自「This is Visual C++ basis operation. Usin」· C++ 代码 · 共 69 行
CPP
69 行
// ButtonDialog.cpp : implementation file
//
#include "stdafx.h"
#include "Exam7_2.h"
#include "ButtonDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CButtonDialog dialog
CButtonDialog::CButtonDialog(CWnd* pParent /*=NULL*/)
: CDialog(CButtonDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CButtonDialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CButtonDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CButtonDialog)
DDX_Control(pDX, IDC_CHANGE, m_change);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CButtonDialog, CDialog)
//{{AFX_MSG_MAP(CButtonDialog)
ON_BN_CLICKED(IDC_CHANGE, OnChange)
ON_BN_CLICKED(IDC_MESSAGE, OnMessage)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CButtonDialog message handlers
void CButtonDialog::OnChange()
{
// TODO: Add your control notification handler code here
static BOOL bflag1=TRUE;
if(bflag1)
{
MessageBox("please watch the label of button");
m_change.SetWindowText("after change");
bflag1=FALSE;
}
else
{
MessageBox("please watch the label of button");
m_change.SetWindowText("change");
bflag1=TRUE;
}
}
void CButtonDialog::OnMessage()
{
// TODO: Add your control notification handler code here
MessageBox("Only display message");
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?