⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex050102cdlg.cpp

📁 深入浅出Visual C++入门进阶与应用实例 随书光盘 作者 何志丹
💻 CPP
字号:
// Ex050102cDlg.cpp : implementation file
//

#include "stdafx.h"
#include "ex050102c.h"
#include "Ex050102cDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CEx050102cDlg dialog


CEx050102cDlg::CEx050102cDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CEx050102cDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CEx050102cDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CEx050102cDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CEx050102cDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CEx050102cDlg, CDialog)
	//{{AFX_MSG_MAP(CEx050102cDlg)
	ON_BN_CLICKED(IDC_CHECK, OnCheck)
	ON_BN_CLICKED(IDC_GETSTATE, OnGetstate)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CEx050102cDlg message handlers

void CEx050102cDlg::OnOK() 
{
	// TODO: Add extra validation here
	
	CDialog::OnOK();
}

void CEx050102cDlg::OnCheck() 
{
	CheckDlgButton(IDC_CHECK1,2);
	CheckRadioButton(IDC_RADIO1,IDC_RADIO3,IDC_RADIO2);
}

void CEx050102cDlg::OnGetstate() 
{
	CString strMess ;
	if(IsDlgButtonChecked(IDC_CHECK1))
		strMess = "复选框被选中\n";
	else
		strMess = "复选框没有被选中\n";
	
	UINT uID = GetCheckedRadioButton(IDC_RADIO1,IDC_RADIO3);
	CString strRadioText ;
	GetDlgItemText(uID,strRadioText);
	if(!strRadioText.IsEmpty())
		strMess += "选中了单选框" + strRadioText ;
	
	AfxMessageBox(strMess);	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -