⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classinfodlg.cpp

📁 个人制作的一个简单的用户登陆窗口 为了实现用户密码登陆
💻 CPP
字号:
// ClassInfoDlg.cpp : implementation file
//

#include "stdafx.h"
#include "ex6.h"
#include "ClassInfoDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CClassInfoDlg dialog


CClassInfoDlg::CClassInfoDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CClassInfoDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CClassInfoDlg)
	m_strClassNO = _T("");
	m_strDepart = _T("");
	m_strSpecial = _T("");
	m_tEnter = 0;
	m_strYear = _T("");
	//}}AFX_DATA_INIT
}


void CClassInfoDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CClassInfoDlg)
	DDX_Text(pDX, IDC_EDIT_CLASSNO, m_strClassNO);
	DDV_MaxChars(pDX, m_strClassNO, 10);
	DDX_Text(pDX, IDC_EDIT_DEPART, m_strDepart);
	DDV_MaxChars(pDX, m_strDepart, 60);
	DDX_Text(pDX, IDC_EDIT_SPECIAL, m_strSpecial);
	DDV_MaxChars(pDX, m_strSpecial, 60);
	DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER1, m_tEnter);
	DDX_CBString(pDX, IDC_COMBO_YEAR, m_strYear);
	DDV_MaxChars(pDX, m_strYear, 10);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CClassInfoDlg message handlers

BOOL CClassInfoDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	m_strYear="4";
	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
}

void CClassInfoDlg::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData();
	m_strClassNO.TrimLeft();
	m_strDepart.TrimLeft();
	m_strSpecial.TrimLeft();
	if(m_strDepart.IsEmpty())
		MessageBox("必须要有所在院系!");
	else if(m_strSpecial.IsEmpty())
		MessageBox("必须要有专业!");
	else
	if(m_strClassNO.IsEmpty())
		MessageBox("必须要有班级号!");
	else
	CDialog::OnOK();
}

⌨️ 快捷键说明

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