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

📄 recordeditbox.cpp

📁 功能描述: 1、快速添加、修改、删除客户信息。 2、直观方便的地域信息管理功能
💻 CPP
字号:
// RecordEditBox.cpp : implementation file
//

#include "stdafx.h"
#include "源程序.h"
#include "RecordEditBox.h"
#include "RainFunction.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CRecordEditBox

CRecordEditBox::CRecordEditBox()
{
}

CRecordEditBox::~CRecordEditBox()
{
}


BEGIN_MESSAGE_MAP(CRecordEditBox, CEdit)
	//{{AFX_MSG_MAP(CRecordEditBox)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CRecordEditBox message handlers



BOOL CRecordEditBox::PreTranslateMessage(MSG* pMsg) 
{
	if(pMsg->message==WM_KEYDOWN && (pMsg->wParam==13 ||pMsg->wParam==9))
	{
		if(this->EmptyValidate==true)
		{
			CString sChar;
			this->GetWindowText(sChar);
			if(sChar.IsEmpty())
			{
				MessageBox("此字段不允许为空!","系统提示",MB_OK|MB_ICONSTOP);
				this->SetFocus();
			}
			else
			{
				pMsg->wParam=9;
			}
		}
		else
		{
			pMsg->wParam=9;	
		}
	}
	return CEdit::PreTranslateMessage(pMsg);
}	

void CRecordEditBox::Init(_RecordsetPtr Record,CString FieldName)
{
	CString Name;
	this->_Record=Record;
	this->_FieldName=FieldName;
	Name=(char*)(_bstr_t)_Record->GetCollect((_bstr_t)_FieldName);
	this->SetWindowText(Name);
}

⌨️ 快捷键说明

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