mfc绘制矩形边框

 1 void Draw(CDCHandle hdc)
 2 {
 3     CRect rect;
 4     GetClientRect(&rect);
 5 
 6     CPen pen;
 7     pen.CreatePen(PS_SOLID, 1, RGB(169, 169, 169));
 8     HPEN oldPen = hdc.SelectPen(pen);
 9     rect.InflateRect(-2, -2, -12, -51);
10     hdc.Rectangle(rect);
11     hdc.SelectPen(oldPen); 
12 }

猜你喜欢

转载自www.cnblogs.com/luoluosha/p/12557536.html