📄 newstudent.cpp
字号:
// NewStudent.cpp : implementation file
//
#include "stdafx.h"
#include "Exam.h"
#include "NewStudent.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNewStudent dialog
CNewStudent::CNewStudent(CWnd* pParent /*=NULL*/)
: CDialog(CNewStudent::IDD, pParent)
{
//{{AFX_DATA_INIT(CNewStudent)
m_sBirthday = _T("");
m_sName = _T("");
m_nSex = -1;
m_nStudentID = 0;
//}}AFX_DATA_INIT
m_nClassNum = 0;
}
void CNewStudent::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CNewStudent)
DDX_Control(pDX, IDC_CLASS, m_ctrlClass);
DDX_Text(pDX, IDC_BIRTHDAY, m_sBirthday);
DDX_Text(pDX, IDC_NAME, m_sName);
DDX_Radio(pDX, IDC_SEX_M, m_nSex);
DDX_Text(pDX, IDC_STUDENT_ID, m_nStudentID);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CNewStudent, CDialog)
//{{AFX_MSG_MAP(CNewStudent)
ON_CBN_SELCHANGE(IDC_CLASS, OnSelchangeClass)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNewStudent message handlers
BOOL CNewStudent::OnInitDialog()
{
CDialog::OnInitDialog();
for (int i = 0; i < m_nClassNum; i++)
m_ctrlClass.AddString(m_sClass[i]);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CNewStudent::OnSelchangeClass()
{
// 得到选中的教师姓名
m_ctrlClass.GetLBText(m_ctrlClass.GetCurSel(), m_sClass[0]);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -