代码拉取完成,页面将自动刷新
// CustomDrawGroupBox.cpp : ʵļ
//
#include "stdafx.h"
#include "CustomDrawGroupBox.h"
// CCustomDrawGroupBox
IMPLEMENT_DYNAMIC(CCustomDrawGroupBox, CButton)
CCustomDrawGroupBox::CCustomDrawGroupBox()
{
m_bkColor = RGB(255,255,255);
m_borderColor = RGB(255,255,255);
}
CCustomDrawGroupBox::~CCustomDrawGroupBox()
{
}
BEGIN_MESSAGE_MAP(CCustomDrawGroupBox, CButton)
ON_WM_PAINT()
END_MESSAGE_MAP()
// CCustomDrawGroupBox Ϣ
void CCustomDrawGroupBox::OnPaint()
{
CPaintDC dc(this);
CRect rcClient;
GetClientRect(&rcClient);
if(dc)
{
CBrush bkBrush;
CPen borderPen(PS_SOLID,1,m_borderColor);
CPoint pt(10,10);
bkBrush.CreateSolidBrush(m_bkColor);
CBrush* pOldBrush = dc.SelectObject(&bkBrush);
CPen* pOldPen = dc.SelectObject(&borderPen);
dc.RoundRect(&rcClient,pt);
dc.SelectObject(pOldBrush);
dc.SelectObject(pOldPen);
dc.SetBkMode(TRANSPARENT);
}
}
void CCustomDrawGroupBox::PreSubclassWindow()
{
CButton::PreSubclassWindow();
//modified the style to avoid text overlap when press tab
ModifyStyle(0, BS_ICON);
}
void CCustomDrawGroupBox::SetBkColor(COLORREF color)
{
m_bkColor = color;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。