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

📄 myedit.cpp

📁 随着计算机信息技术的飞速发展
💻 CPP
字号:
// MyEdit.cpp : implementation file
//

#include "stdafx.h"
#include "Editi.h"
#include "MyEdit.h"
#include "EditiDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMyEdit

CMyEdit::CMyEdit()
{
    CEditiDlg::m_Ikey=0;
}

CMyEdit::~CMyEdit()
{
}

BEGIN_MESSAGE_MAP(CMyEdit, CEdit)
	//{{AFX_MSG_MAP(CMyEdit)
	ON_WM_KILLFOCUS()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyEdit message handlers

BOOL CMyEdit::PreTranslateMessage(MSG* pMsg) 
{
	// TODO: Add your specialized code here and/or call the base class
	//拦截ESC键和RETURN键按下的消息,解释为WM_KILLFOCUS消息
	if( pMsg->message==WM_KEYDOWN )
	{
		if( pMsg->wParam==13 )		//回车键
		{
            CEditiDlg::m_Ikey=13;
			pMsg->message = WM_KILLFOCUS;
		}
		else if( pMsg->wParam==27 )	//ESC键
		{
            CEditiDlg::m_Ikey=27;
			pMsg->message = WM_KILLFOCUS;
		}
	}
	
	return CEdit::PreTranslateMessage(pMsg);
}

void CMyEdit::OnKillFocus(CWnd* pNewWnd) 
{
	CEdit::OnKillFocus(pNewWnd);
	
	// TODO: Add your message handler code here
    ((GetParent())->GetParent())->SendMessage(GRID_DATA_CHANGED);		
}

⌨️ 快捷键说明

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