finddlg.cpp

来自「实现了一个聊天系统的客户端」· C++ 代码 · 共 92 行

CPP
92
字号
// FindDlg.cpp : implementation file
//

#include "stdafx.h"
#include "MyQQClient.h"
#include "FindDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CFindDlg dialog


CFindDlg::CFindDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CFindDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CFindDlg)
	m_nID = 0;
	//}}AFX_DATA_INIT
}


void CFindDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFindDlg)
	DDX_Control(pDX, IDC_ID_MSG, m_msgID);
	DDX_Control(pDX, IDC_FIND_BTN, m_btnFind);
	DDX_Control(pDX, IDC_CANCEL, m_btnCancel);
	DDX_Text(pDX, IDC_ID_EDIT, m_nID);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CFindDlg, CDialog)
	//{{AFX_MSG_MAP(CFindDlg)
	ON_BN_CLICKED(IDC_FIND_BTN, OnFindBtn)
	ON_BN_CLICKED(IDC_CANCEL, OnCancel)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFindDlg message handlers

void CFindDlg::OnOK() 
{
	// TODO: Add extra validation here
	
	//CDialog::OnOK();
}

void CFindDlg::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	CDialog::OnCancel();
}

void CFindDlg::OnFindBtn() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);

	if(( m_nID < 10000000) || (m_nID > 99999999)) {
		MessageBox("请输入正确的用户ID!");
		return ;
	}

	CDialog::OnOK();
}

void CFindDlg::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	
	// TODO: Add your message handler code here
	CRect rect;
	GetClientRect(&rect);

	CBrush * br = new CBrush(RGB(192,192,255));
	if ( br ) {
		dc.FillRect(&rect,br);
		delete br;
	}	
	// Do not call CDialog::OnPaint() for painting messages
}

⌨️ 快捷键说明

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