studentinfo1.cpp

来自「画简单的图形用VC++开发的利用鼠标响应程序的实行」· C++ 代码 · 共 57 行

CPP
57
字号
// StudentInfo1.cpp : implementation file
//

#include "stdafx.h"
#include "画图.h"
#include "StudentInfo1.h"

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

/////////////////////////////////////////////////////////////////////////////
// CStudentInfo1 dialog


CStudentInfo1::CStudentInfo1(CWnd* pParent /*=NULL*/)
	: CDialog(CStudentInfo1::IDD, pParent)
{
	//{{AFX_DATA_INIT(CStudentInfo1)
	m_sex = 0;
	m_age = 22;
	m_name = _T("励科杰");
	//}}AFX_DATA_INIT
}


void CStudentInfo1::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CStudentInfo1)
	DDX_CBIndex(pDX, IDC_COMBO_SEX, m_sex);
	DDX_Text(pDX, IDC_EDIT_AGE, m_age);
	DDV_MinMaxInt(pDX, m_age, 22, 30);
	DDX_Text(pDX, IDC_EDIT_NAME, m_name);
	DDV_MaxChars(pDX, m_name, 8);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CStudentInfo1, CDialog)
	//{{AFX_MSG_MAP(CStudentInfo1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CStudentInfo1 message handlers

void CStudentInfo1::OnOK() 
{
	// TODO: Add extra validation here
	CDialog::OnOK();
	UpdateData();
	name=m_name;
}

⌨️ 快捷键说明

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