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

📄 bkchgedit.cpp

📁 通过COM1与单片机通讯的界面程序
💻 CPP
字号:
// BkChgEdit.cpp : implementation file
//

#include "stdafx.h"
#include "SeriesPort.h"
#include "BkChgEdit.h"

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

/////////////////////////////////////////////////////////////////////////////
// BkChgEdit

BkChgEdit::BkChgEdit()	
    
{ 
	//m_BkColor=0x00000000;

}

BkChgEdit::~BkChgEdit()
{
}


BEGIN_MESSAGE_MAP(BkChgEdit, CEdit)
	//{{AFX_MSG_MAP(BkChgEdit)
//	ON_WM_CTLCOLOR_REFLECT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// BkChgEdit message handlers

//DEL void BkChgEdit::SetBkColor(COLORREF color)
//DEL {
//DEL 	m_BkColor=color;
//DEL 
//DEL }

//DEL HBRUSH BkChgEdit::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
//DEL {
//DEL 	HBRUSH hbr = CEdit::OnCtlColor(pDC, pWnd, nCtlColor);
//DEL 	
//DEL 	// TODO: Change any attributes of the DC here
//DEL //	CDC* dc=GetDC();
//DEL //	dc->SetBkColor(m_BkColor);
//DEL 	
//DEL 	// TODO: Return a different brush if the default is not desired
//DEL 	return hbr;
//DEL }

//DEL HBRUSH BkChgEdit::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
//DEL {
//DEL 	HBRUSH hbr = CEdit::OnCtlColor(pDC, pWnd, nCtlColor);
//DEL 	
//DEL 	// TODO: Change any attributes of the DC here
//DEL 
//DEL 	CDC* dc=GetDC();
//DEL 	CRect rect;
//DEL 	GetClientRect(rect);
//DEL 	rect.InflateRect(1,1,1,1);
//DEL 	CPen pen(PS_SOLID,1,m_BkColor);
//DEL 
//DEL 	dc->SelectObject(&pen);
//DEL 	CBrush brush(m_BkColor);
//DEL 	dc->FrameRect(rect,&brush);
//DEL 	
//DEL 	// TODO: Return a different brush if the default is not desired
//DEL //	return hbr;
//DEL 	return NULL;
//DEL }

//DEL void BkChgEdit::SetBkColor(COLORREF color)
//DEL {
//DEL 	m_BkColor=color;
//DEL 
//DEL }

//DEL HBRUSH BkChgEdit::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
//DEL {
//DEL 	HBRUSH hbr = CEdit::OnCtlColor(pDC, pWnd, nCtlColor);
//DEL 	
//DEL 	// TODO: Change any attributes of the DC here
//DEL 	
//DEL 	// TODO: Return a different brush if the default is not desired
//DEL 	return hbr;
//DEL }

//DEL HBRUSH BkChgEdit::CtlColor(CDC* pDC, UINT nCtlColor) 
//DEL {
//DEL 	// TODO: Change any attributes of the DC here
//DEL 	CDC* dc = GetDC(); //获取画布对象
//DEL 	CRect rect;
//DEL 	GetClientRect(rect); //获取客户区域
//DEL 	rect.InflateRect(1,1,1,1);//将客户区域增大一个像素
//DEL 	
//DEL 	CPen pen(PS_SOLID,1,m_BkColor); //创建画笔
//DEL 	dc->SelectObject(&pen);
//DEL 		
//DEL 	CBrush brush (m_BkColor);//创建画刷
//DEL 
//DEL 	dc->FrameRect(rect,&brush);//绘制边框
//DEL //	dc->FillRect(&rect,&brush);//绘制边框
//DEL pDC->SetTextColor(RGB(255,0,0));  // blue
//DEL 
//DEL 	
//DEL 	// TODO: Return a non-NULL brush if the parent's handler should not be called
//DEL 	return NULL;
//DEL }


//DEL void BkChgEdit::SetBkColor(COLORREF color)
//DEL {
//DEL   m_BkColor=color;
//DEL   HBRUSH BkChgEdit::CtlColor(CDC* pDC, UINT nCtlColor);
//DEL 
//DEL }

⌨️ 快捷键说明

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