📄 sbutton.cpp
字号:
// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -