📄 stuinfodlg.cpp
字号:
// StuInfoDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Ex_Ctrls.h"
#include "StuInfoDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CStuInfoDlg dialog
CStuInfoDlg::CStuInfoDlg(CWnd* pParent /*=NULL*/)
: CDialog(CStuInfoDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CStuInfoDlg)
m_tBirth = 0;
m_strName = _T("");
m_strNo = _T("");
m_bMale = -1;
m_strSpecial = _T("");
//}}AFX_DATA_INIT
}
void CStuInfoDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CStuInfoDlg)
DDX_Control(pDX, IDC_COMBO_SPECIAL, m_comboSpecial);
DDX_DateTimeCtrl(pDX, IDC_DATE_BIRTH, m_tBirth);
DDX_Text(pDX, IDC_EDIT_STUNAME, m_strName);
DDV_MaxChars(pDX, m_strName, 50);
DDX_Text(pDX, IDC_EDIT_STUNO, m_strNo);
DDV_MaxChars(pDX, m_strNo, 50);
DDX_Radio(pDX, IDC_RADIO_BOY, m_bMale);
DDX_CBString(pDX, IDC_COMBO_SPECIAL, m_strSpecial);
DDV_MaxChars(pDX, m_strSpecial, 50);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CStuInfoDlg, CDialog)
//{{AFX_MSG_MAP(CStuInfoDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CStuInfoDlg message handlers
void CStuInfoDlg::OnOK()
{
// TODO: Add extra validation here
UpdateData();
m_strName.TrimLeft();
if(m_strName.IsEmpty())
{
MessageBox("姓名不能为空!");
return ;
}
m_strNo.TrimLeft();
if(m_strNo.IsEmpty())
{
MessageBox("学号不能为空!");
return ;
}
if(m_bMale==-1)
{
MessageBox("请选择你喜欢的性别^_^ !");
return ;
}
CDialog::OnOK();
}
///////////////////////////////////////////
BOOL CStuInfoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_comboSpecial.AddString("机械工程及其自动化");
m_comboSpecial.AddString("电气工程及其自动化");
m_comboSpecial.AddString("网络工程");
m_strSpecial=" 机械工程及其自动化";
UpdateData(FALSE);
// TODO: Add extra initialization here
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -