sbutton.cpp

来自「利用注册表键值调用输入法」· C++ 代码 · 共 71 行

CPP
71 行
字号
// Sbutton.cpp : implementation file
//

#include "stdafx.h"
#include "eyes.h"
#include "Sbutton.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSbutton

CSbutton::CSbutton()
{
	bActive=0;
	m_Brush.CreateSolidBrush(RGB(0,255,0));
	m_font.CreatePointFont(200,"Times New Roman");
}

CSbutton::~CSbutton()
{
}


BEGIN_MESSAGE_MAP(CSbutton, CStatic)
	//{{AFX_MSG_MAP(CSbutton)
	ON_WM_CTLCOLOR_REFLECT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSbutton message handlers

void CSbutton::Drawed(CWnd *pWnd , int bg_color_ref, CString str)
{ 
	CClientDC dc(this);
	CRect rcClient;
	GetClientRect(&rcClient);

	//设计显示字符
	pWnd->SetWindowText(str);
	
}

void CSbutton::Set(CWnd *pWnd , int bg_color_ref, CString str)
{ 
	this->m_pWnd = pWnd;
	m_str = str;
	BG_COLOR_REF = bg_color_ref ;
	Drawed(m_pWnd,BG_COLOR_REF,m_str);


}




HBRUSH CSbutton::CtlColor(CDC* pDC, UINT nCtlColor) 
{
	// TODO: Change any attributes of the DC here
	pDC->SetBkColor(RGB(0,255,0));
	pDC->SelectObject(&m_font);
	// TODO: Return a non-NULL brush if the parent's handler should not be called
	if(bActive==1)return (HBRUSH)m_Brush;
	return NULL;
}

⌨️ 快捷键说明

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