borrowdlg.cpp

来自「适合MFC初学者学习」· C++ 代码 · 共 77 行

CPP
77
字号
// BorrowDlg.cpp : implementation file
//

#include "stdafx.h"
#include "LLL.h"
#include "BorrowDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CBorrowDlg dialog


CBorrowDlg::CBorrowDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CBorrowDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CBorrowDlg)
	m_name = _T("");
	m_borrowman = _T("");
	m_choice = 0;
	m_number = _T("");
	//}}AFX_DATA_INIT
}


void CBorrowDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CBorrowDlg)
	DDX_Text(pDX, IDC_EDIT2, m_name);
	DDX_Text(pDX, IDC_EDIT3, m_borrowman);
	DDX_Radio(pDX, IDC_RADIO1, m_choice);
	DDX_Text(pDX, IDC_EDIT1, m_number);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CBorrowDlg, CDialog)
	//{{AFX_MSG_MAP(CBorrowDlg)
	ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
	ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBorrowDlg message handlers

void CBorrowDlg::OnRadio1() 
{
	// TODO: Add your control notification handler code here
	GetDlgItem(IDC_EDIT2)->EnableWindow(FALSE);
	GetDlgItem(IDC_EDIT1)->EnableWindow(TRUE);
}

void CBorrowDlg::OnRadio2() 
{
	// TODO: Add your control notification handler code here
	GetDlgItem(IDC_EDIT2)->EnableWindow(TRUE);
	GetDlgItem(IDC_EDIT1)->EnableWindow(FALSE);
}

BOOL CBorrowDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	GetDlgItem(IDC_EDIT2)->EnableWindow(FALSE);
	GetDlgItem(IDC_EDIT1)->EnableWindow(TRUE);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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