userpage1.cpp

来自「数据库课件。适用于培训、教学。PPT格式。」· C++ 代码 · 共 71 行

CPP
71
字号
// UserPage1.cpp : implementation file
//

#include "stdafx.h"
#include "AdoAdrBook.h"
#include "UserPage1.h"

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

/////////////////////////////////////////////////////////////////////////////
// CUserPage1 property page

IMPLEMENT_DYNCREATE(CUserPage1, CPropertyPage)

CUserPage1::CUserPage1() : CPropertyPage(CUserPage1::IDD)
{
	//{{AFX_DATA_INIT(CUserPage1)
	m_address = _T("");
	m_email = _T("");
	m_homePhone = _T("");
	m_mobilePhone = _T("");
	m_name = _T("");
	m_workPhone = _T("");
	//}}AFX_DATA_INIT
}

CUserPage1::~CUserPage1()
{
}

void CUserPage1::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CUserPage1)
	DDX_Text(pDX, IDC_ADDRESS, m_address);
	DDX_Text(pDX, IDC_EMAIL, m_email);
	DDX_Text(pDX, IDC_HOMEPHONE, m_homePhone);
	DDX_Text(pDX, IDC_MOBILEPHONE, m_mobilePhone);
	DDX_Text(pDX, IDC_NAME, m_name);
	DDX_Text(pDX, IDC_WORKPHONE, m_workPhone);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CUserPage1, CPropertyPage)
	//{{AFX_MSG_MAP(CUserPage1)
		// NOTE: the ClassWizard will add message map macros here
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CUserPage1 message handlers

BOOL CUserPage1::OnKillActive() 
{
	// TODO: Add your specialized code here and/or call the base class
	UpdateData(TRUE);
    if(m_name.IsEmpty())
	{
		AfxMessageBox("姓名不能不能空");
		return FALSE ;
	}
	else 
		return TRUE;
	//return CPropertyPage::OnKillActive();
}

⌨️ 快捷键说明

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