1 Star 0 Fork 9

tdivwkl / MFCSkin

forked from xmsharp / MFCSkin 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CustomDrawBtn.h 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
xmsharp 提交于 2020-04-24 14:25 . 新增文件
#pragma once
// CCustomDrawBtn
//自绘圆角矩形按钮
class CCustomDrawBtn : public CButton
{
DECLARE_DYNAMIC(CCustomDrawBtn)
public:
CCustomDrawBtn();
virtual ~CCustomDrawBtn();
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
virtual void PreSubclassWindow();
void SetColorStyle(COLORREF bkColor,COLORREF hoverColor,COLORREF textColor,COLORREF borderColor,int fontSize,int radis);
void SetFontSize(int fontsize);
void SetTextColor(COLORREF color);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnTimer(UINT nIDEvent);
protected:
DECLARE_MESSAGE_MAP()
void Draw(LPDRAWITEMSTRUCT lpDrSt,CDC* pDC,CRect rect,int roundRadis,COLORREF bkColor,CString strText);
void Redraw(LPDRAWITEMSTRUCT lpDrSt);
private:
CRect m_rcDrawClient;//绘制区域
COLORREF m_bkColor;//默认背景颜色
COLORREF m_hoverColor;//鼠标移动上去的颜色
COLORREF m_textColor;//文字颜色
COLORREF m_borderColor;//边框颜色
COLORREF m_drawBkColor;
int m_fontSize;//字体大小
int m_radis;//圆角幅度>0,=0 无圆角
BOOL m_bPaintedHighLight;//是否已经画了高亮色
CString m_btnText;
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/tdivwkl/MFCSkin.git
git@gitee.com:tdivwkl/MFCSkin.git
tdivwkl
MFCSkin
MFCSkin
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891