1、在DrawItem中直接自己自绘
//画圆角矩形/
HRGN h_rgn = CreateRoundRectRgn(0,0,rect.right,rect.bottom,rect.Width()/2,rect.Height());
SetWindowRgn(h_rgn,TRUE);
// 圆角矩形填充颜色
CBrush brush;
brush.CreateSolidBrush(RGB(80,150,100));
dc.SelectObject(&brush);
dc.RoundRect(0,0,rect.right,rect.bottom,rect.Width()/4,rect.Height());
dc.SetTextColor(RGB(255,250,0));
dc.SelectObject(GetStockObject(NULL_BRUSH));
2、在drawitem中贴图,图片背景与对话框背景相同
以上两种方法都是自定义button类,然后重写drawitem函数。
//画圆角矩形/
HRGN h_rgn = CreateRoundRectRgn(0,0,rect.right,rect.bottom,rect.Width()/2,rect.Height());
SetWindowRgn(h_rgn,TRUE);
// 圆角矩形填充颜色
CBrush brush;
brush.CreateSolidBrush(RGB(80,150,100));
dc.SelectObject(&brush);
dc.RoundRect(0,0,rect.right,rect.bottom,rect.Width()/4,rect.Height());
dc.SetTextColor(RGB(255,250,0));
dc.SelectObject(GetStockObject(NULL_BRUSH));
2、在drawitem中贴图,图片背景与对话框背景相同
以上两种方法都是自定义button类,然后重写drawitem函数。