添加 ON_WM_NCPAINT
void CMyDlg::OnNcPaint()
{
CDialog::OnNcPaint();// for painting messages
CDC *pDC=GetWindowDC();
//CPoint pt;pt.x=2;pt.y=2;
//pDC->DrawIcon(pt,m_hIcon);
CRect rc;GetWindowRect(&rc);
CPen blackpen,graypen,whitepen;CPen *oldpen;
whitepen.CreatePen(PS_SOLID,1,RGB(255,255,255));
graypen.CreatePen(PS_SOLID,1,RGB(180,180,180));
blackpen.CreatePen(PS_SOLID,1,RGB(100,100,100));
oldpen=pDC->SelectObject(&whitepen);
pDC->MoveTo(rc.Width()-30,16);
pDC->LineTo(rc.Width()-30,6);
pDC->LineTo(rc.Width()-22,6);
pDC->SelectObject(&graypen);
pDC->LineTo(rc.Width()-22,15);
pDC->LineTo(rc.Width()-30,15);
pDC->SelectObject(&blackpen);
pDC->MoveTo(rc.Width()-30,16);
pDC->LineTo(rc.Width()-22,16);
pDC->LineTo(rc.Width()-22,6);
CBrush *pBrush=new CBrush;pBrush->CreateSolidBrush(RGB(200,200,200));
pDC->FillRect(CRect(rc.Width()-29,7,rc.Width()-23,14),pBrush);
pDC->MoveTo(rc.Width()-28,12);
pDC->LineTo(rc.Width()-24,12);
pDC->SelectObject(oldpen);
pDC=new CDC;
}
然后在自己处理ON_WM_NCLBUTTONDOWN事件
添加菜单栏自绘按钮
免责声明:文章转载自《添加菜单栏自绘按钮》仅用于学习参考。如对内容有疑问,请及时联系本站处理。
上篇Python字符串格式化satisfy with用法下篇
宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=