📄 searchdlg1.cpp
字号:
// SearchDlg1.cpp : implementation file
//
#include "stdafx.h"
#include "Address.h"
#include "SearchDlg1.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// SearchDlg dialog
SearchDlg::SearchDlg(CWnd* pParent /*=NULL*/)
: CDialog(SearchDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(SearchDlg)
m_keyword = _T("");
m_search_field = _T("");
//}}AFX_DATA_INIT
}
void SearchDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SearchDlg)
DDX_Control(pDX, IDC_KEY, m_ctrl_key);
DDX_Control(pDX, IDC_SEARCH_STYLE, m_search_ctrl_field);
DDX_Text(pDX, IDC_KEY, m_keyword);
DDX_CBString(pDX, IDC_SEARCH_STYLE, m_search_field);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(SearchDlg, CDialog)
//{{AFX_MSG_MAP(SearchDlg)
ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// SearchDlg message handlers
void SearchDlg::OnRadio1()
{
// TODO: Add your control notification handler code here
m_bExact = TRUE;
}
void SearchDlg::OnRadio2()
{
// TODO: Add your control notification handler code here
m_bExact = FALSE;
}
void SearchDlg::OnOK()
{
// TODO: Add extra validation here
UpdateData( TRUE );
if( m_keyword.IsEmpty() )
{
MessageBox("请填写查询关键字","提示",MB_OK|MB_ICONINFORMATION);
m_ctrl_key.SetFocus();
return;
}
CDialog::OnOK();
}
BOOL SearchDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
//默认为“精确查询”按钮被选中
CDialog::CheckRadioButton(IDC_RADIO1,IDC_RADIO2,IDC_RADIO1);
//默认“姓名”项被选中
m_search_ctrl_field.SetCurSel(0);
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 + -