代码拉取完成,页面将自动刷新
同步操作将从 xmsharp/MFCSkin 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
// CustomDrawEdit.cpp : ʵļ
//
#include "stdafx.h"
#include "CustomDrawEdit.h"
// CCustomDrawEdit
IMPLEMENT_DYNAMIC(CCustomDrawEdit, CEdit)
CCustomDrawEdit::CCustomDrawEdit()
{
m_bkColor = RGB(241,241,241);
m_txtColor = RGB(113,113,113);
m_bDraw = FALSE;
m_bkBrush.CreateSolidBrush(m_bkColor);
}
CCustomDrawEdit::~CCustomDrawEdit()
{
m_bkBrush.DeleteObject();
}
BEGIN_MESSAGE_MAP(CCustomDrawEdit, CEdit)
ON_WM_PAINT()
ON_WM_NCPAINT()
ON_WM_CTLCOLOR_REFLECT()
END_MESSAGE_MAP()
// CCustomDrawEdit Ϣ
HBRUSH CCustomDrawEdit::CtlColor(CDC* pDC, UINT nCtlColor)
{
// TODO: Change any attributes of the DC here
// TODO: Return a non-NULL brush if the parent's handler should not be called
// TODO: Return a non-NULL brush if the parent's handler should not be called
//set text color
pDC->SetTextColor(m_txtColor);
//set the text's background color
pDC->SetBkColor(m_bkColor);
//return the brush used for background this sets control background
return m_bkBrush;
}
void CCustomDrawEdit::OnPaint()
{
CEdit::OnPaint();
}
void CCustomDrawEdit::OnNcPaint()
{
CEdit::OnNcPaint();
}
void CCustomDrawEdit::Draw()
{
}
void CCustomDrawEdit::SetBkColor(COLORREF color)
{
m_bkColor = color;
//free brush
if (m_bkBrush.GetSafeHandle())
m_bkBrush.DeleteObject();
//set brush to new color
m_bkBrush.CreateSolidBrush(color);
//redraw
Invalidate(TRUE);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。