📄 querydlg.cpp
字号:
// QueryDlg.cpp : implementation file
//
#include "stdafx.h"
#include "AddressList.h"
#include "QueryDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CQueryDlg dialog
CQueryDlg::CQueryDlg(CWnd* pParent /*=NULL*/)
: CDialog(CQueryDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CQueryDlg)
m_e1 = _T("");
m_e2 = _T("");
m_e3 = _T("");
m_e4 = _T("");
//}}AFX_DATA_INIT
}
void CQueryDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CQueryDlg)
DDX_Control(pDX, IDC_COMBO1, m_cbo1);
DDX_Control(pDX, IDC_EDIT4, m_ce4);
DDX_Control(pDX, IDC_EDIT3, m_ce3);
DDX_Control(pDX, IDC_EDIT2, m_ce2);
DDX_Control(pDX, IDC_EDIT1, m_ce1);
DDX_Control(pDX, IDC_COMBO4, m_cbo4);
DDX_Control(pDX, IDC_COMBO3, m_cbo3);
DDX_Control(pDX, IDC_COMBO2, m_cbo2);
DDX_Control(pDX, IDC_CHECK4, m_c4);
DDX_Control(pDX, IDC_CHECK3, m_c3);
DDX_Control(pDX, IDC_CHECK2, m_c2);
DDX_Control(pDX, IDC_CHECK1, m_c1);
DDX_Control(pDX, IDC_CHECK_CDT4, m_cdt4);
DDX_Control(pDX, IDC_CHECK_CDT3, m_cdt3);
DDX_Control(pDX, IDC_CHECK_CDT2, m_cdt2);
DDX_Control(pDX, IDC_CHECK_CDT1, m_cdt1);
DDX_Text(pDX, IDC_EDIT1, m_e1);
DDX_Text(pDX, IDC_EDIT2, m_e2);
DDX_Text(pDX, IDC_EDIT3, m_e3);
DDX_Text(pDX, IDC_EDIT4, m_e4);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CQueryDlg, CDialog)
//{{AFX_MSG_MAP(CQueryDlg)
ON_BN_CLICKED(IDC_CHECK_CDT2, OnCheckCdt2)
ON_BN_CLICKED(IDC_CHECK_CDT3, OnCheckCdt3)
ON_BN_CLICKED(IDC_CHECK_CDT4, OnCheckCdt4)
ON_BN_CLICKED(IDC_BUTTON_OK, OnButtonOk)
ON_BN_CLICKED(IDC_CHECK_CDT1, OnCheckCdt1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CQueryDlg message handlers
void CQueryDlg::OnCheckCdt2()
{
// TODO: Add your control notification handler code here
if(m_cdt2.GetCheck() == 1)
{
m_ce2.EnableWindow(true);
m_c2.EnableWindow(true);
m_cbo2.EnableWindow(true);
bt = &m_cbo2;
addcbo();
}
else
{
m_ce2.EnableWindow(false);
m_c2.EnableWindow(false);
m_cbo2.EnableWindow(false);
}
}
void CQueryDlg::OnCheckCdt3()
{
// TODO: Add your control notification handler code here
if(m_cdt3.GetCheck() == 1)
{
m_ce3.EnableWindow(true);
m_c3.EnableWindow(true);
m_cbo3.EnableWindow(true);
bt = &m_cbo3;
addcbo();
}
else
{
m_ce3.EnableWindow(false);
m_c3.EnableWindow(false);
m_cbo3.EnableWindow(false);
}
}
void CQueryDlg::OnCheckCdt4()
{
// TODO: Add your control notification handler code here
if(m_cdt4.GetCheck() == 1)
{
m_ce4.EnableWindow(true);
m_c4.EnableWindow(true);
m_cbo4.EnableWindow(true);
bt = &m_cbo4;
addcbo();
}
else
{
m_ce4.EnableWindow(false);
m_c4.EnableWindow(false);
m_cbo4.EnableWindow(false);
}
}
void CQueryDlg::OnButtonOk()
{
// TODO: Add your control notification handler code here
CDialog::OnOK();
}
void CQueryDlg::addcbo()
{
bt->Clear();
bt->AddString("姓名");
bt->AddString("性别");
bt->AddString("出生日期");
bt->AddString("籍贯");
bt->AddString("移动电话");
bt->AddString("住宅电话");
bt->AddString("腾讯QQ");
bt->AddString("MSN");
bt->AddString("EMail");
bt->AddString("家庭地址");
bt->AddString("单位名称");
bt->AddString("单位电话");
bt->AddString("单位地址");
}
void CQueryDlg::OnCheckCdt1()
{
// TODO: Add your control notification handler code here
if(m_cdt1.GetCheck() == 1)
{
UpdateData(false);
m_ce1.EnableWindow(true);
m_c1.EnableWindow(true);
m_cbo1.EnableWindow(true);
bt = &m_cbo1;
addcbo();
}
else
{
m_ce1.EnableWindow(false);
m_c1.EnableWindow(false);
m_cbo1.EnableWindow(false);
}
}
BOOL CQueryDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// 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 + -