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

📄 rxgrid_cell.cpp

📁 1.数据库文件名:spxxglxt(位置:商品销售管理系统商品销售管理系统dataspxxglxt_Data.MDF文件 和 商品销售管理系统商品销售管理系统dataspxxglxt_Log.LDF
💻 CPP
字号:
// RxGrid_Cell.cpp : implementation file
//

#include "stdafx.h"
#include "RxGrid_Cell.h"
#include "RxGrid.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// RxGrid_Cell

RxGrid_Cell::RxGrid_Cell()
{
}

RxGrid_Cell::~RxGrid_Cell()
{
}
BEGIN_MESSAGE_MAP(RxGrid_Cell, CEdit)
	//{{AFX_MSG_MAP(RxGrid_Cell)
	ON_WM_CREATE()
	ON_WM_KILLFOCUS()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// RxGrid_Cell message handlers


int RxGrid_Cell::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CEdit::OnCreate(lpCreateStruct) == -1)
		return -1;	
		//设置字体、字号
	LOGFONT logfont;
	logfont.lfCharSet=134;
	logfont.lfClipPrecision=0;
	logfont.lfEscapement=0;
	logfont.lfHeight=-12;
	logfont.lfItalic=0;
	logfont.lfOrientation=0;
	logfont.lfOutPrecision=0;
	logfont.lfPitchAndFamily=2;
	logfont.lfQuality=0,
	logfont.lfStrikeOut=0;
	logfont.lfUnderline=0;
	logfont.lfWeight=400;
	logfont.lfWidth=0;
	strcpy(logfont.lfFaceName,"宋体");
	m_Font.DeleteObject();
	m_Font.CreateFontIndirect(&logfont);
	this->SetFont(&m_Font);
	return 0;
}

void RxGrid_Cell::OnKillFocus(CWnd* pNewWnd) 
{
	RxGrid* Parent =(RxGrid*)GetParent();
	if(Parent)
		Parent->EndEdit();	
	CEdit::OnKillFocus(pNewWnd);

}


BOOL RxGrid_Cell::PreTranslateMessage(MSG* pMsg) 
{	
	RxGrid* Parent =(RxGrid*)GetParent();
	if(pMsg->message==WM_KEYDOWN && pMsg->wParam==13)
	{
		Parent->MoveNextItem();
		pMsg->hwnd=Parent->GetParent()->GetSafeHwnd();
		pMsg->message=DIY_ONCELLCHANGE;
	}
	return CEdit::PreTranslateMessage(pMsg);
}


⌨️ 快捷键说明

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