📄 cha.cpp
字号:
// Cha.cpp : implementation file
//
#include "stdafx.h"
#include "EXAM4.h"
#include "Cha.h"
#include "afxdb.h"
#include "DCha.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCha dialog
CCha::CCha(CWnd* pParent /*=NULL*/)
: CDialog(CCha::IDD, pParent)
{
//{{AFX_DATA_INIT(CCha)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CCha::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCha)
DDX_Control(pDX, IDC_EDIT3, m_chactime);
DDX_Control(pDX, IDC_EDIT2, m_chacname);
DDX_Control(pDX, IDC_EDIT1, m_chainput);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCha, CDialog)
//{{AFX_MSG_MAP(CCha)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCha message handlers
void CCha::OnButton1()
{
// TODO: Add extra validation here
CString strchacname;
m_chainput.GetWindowText(strchacname);
CDCha k;
k.Open();
k.m_strFilter="cname='"+strchacname+"'";
k.Requery();
if(strchacname==k.m_cname)//if(strkey==l.m_key)
{
GetDlgItem(IDC_EDIT2)->SetWindowText(strchacname);
GetDlgItem(IDC_EDIT3)->SetWindowText(k.m_ctime);
// MessageBox("ok");
}
else
MessageBox("input error");
// CDialog::OnOK();
}
void CCha::OnButton2()
{
// TODO: Add your control notification handler code here
CDialog::OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -