代码拉取完成,页面将自动刷新
// CustomerStatic.cpp : ʵļ
//
#include "stdafx.h"
#include "CustomerStatic.h"
// CCustomerStatic
IMPLEMENT_DYNAMIC(CCustomerDrawStatic, CStatic)
CCustomerDrawStatic::CCustomerDrawStatic()
{
m_txtColor = RGB(0,0,0);
m_bkColor = RGB(255,255,255);
m_bChangeCursor = FALSE;
m_bTransparent = TRUE;
m_bkBrush.CreateSolidBrush(m_bkColor);
}
CCustomerDrawStatic::~CCustomerDrawStatic()
{
}
BEGIN_MESSAGE_MAP(CCustomerDrawStatic, CStatic)
ON_WM_CTLCOLOR_REFLECT()
ON_WM_MOUSEMOVE(WM_MOUSEMOVE,CCustomerDrawStatic::OnMouseMove)
END_MESSAGE_MAP()
// CCustomerStatic Ϣ
HBRUSH CCustomerDrawStatic::CtlColor(CDC* pDC, UINT nCtlColor)
{
if(m_bTransparent)
{
pDC->SetBkMode(TRANSPARENT);
pDC->SetTextColor(m_txtColor);
return (HBRUSH)GetStockObject(HOLLOW_BRUSH);
}
else
{
pDC->SetBkColor(m_bkColor);
pDC->SetTextColor(m_txtColor);
return m_bkBrush;
}
}
void CCustomerDrawStatic::SetTextColor(COLORREF color)
{
m_txtColor = color;
Invalidate(TRUE);
}
void CCustomerDrawStatic::SetBkTransparent(BOOL bTrans)
{
m_bTransparent = bTrans;
}
void CCustomerDrawStatic::SetBkColor(COLORREF color)
{
m_bkColor = color;
if(m_bkBrush.GetSafeHandle())
{
m_bkBrush.DeleteObject();
m_bkBrush.CreateSolidBrush(color);
}
Invalidate(TRUE);
}
void CCustomerDrawStatic::OnMouseMove(UINT nFlags, CPoint point)
{
if(m_bChangeCursor){
HCURSOR hcur = ::LoadCursor(NULL,IDC_HAND);
::SetCursor(hcur);
}
}
void CCustomerDrawStatic::SetNeedChangeCur(BOOL bChange)
{
m_bChangeCursor = bChange;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。