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

📄 searchdlg1.cpp

📁 我自己写的一个通讯录的程序,用ODBC来连接数据库. 可以查找,添加,删除,和修改记录,并显示数据库中人所有记录. 登录程序的默认密码为空,可以在程序中修改.
💻 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 + -