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

📄 baselistbox.cpp

📁 用VC++编写的汽配管理系统,实用简单,程序简单模块化
💻 CPP
字号:
// BaseListBox.cpp : implementation file
//

#include "stdafx.h"
#include "qpglxt.h"
#include "BaseListBox.h"

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

/////////////////////////////////////////////////////////////////////////////
// CBaseListBox

CBaseListBox::CBaseListBox()
{
}

CBaseListBox::~CBaseListBox()
{
}


BEGIN_MESSAGE_MAP(CBaseListBox, CListBox)
	//{{AFX_MSG_MAP(CBaseListBox)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBaseListBox message handlers

void CBaseListBox::SetDatabase(RxRecordset bsrt,CString sField)
{
	rst=bsrt;
	CString sText;
	for(int i=0;i<rst.GetRecordCount();i++)
	{
		rst.Move(i);
		sText=rst.GetFieldValue(sField);
		this->AddString(sText);
	}

}

void CBaseListBox::Refresh(CString sField)
{
	int err=0,i=0;
	while(err!=CB_ERR)
	{
		err=this->DeleteString(0);
		i++;
	}
	CString sText;
	for(i=0;i<rst.GetRecordCount();i++)
	{
		rst.Move(i);
		sText=rst.GetFieldValue(sField);
		this->AddString(sText);
	}

}

BOOL CBaseListBox::PreTranslateMessage(MSG* pMsg) 
{
	if(pMsg->message==WM_KEYDOWN && pMsg->wParam==13)
		pMsg->wParam=9;
	return CListBox::PreTranslateMessage(pMsg);
}

⌨️ 快捷键说明

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