From: http://hi.baidu.com/dqf8/blog/item/56258ed62c658b2707088bb5.html
1、从CEDIT派生CMyEdit
2、添加代码:
void CMyEdit::OnPaint() { CPaintDC dc(this); CPaintDC dc(this); // device context for painting // TODO: Add your message handler code here CRect rect; GetWindowRect(rect); rect.left += 1; rect.right -= 1; rect.top += 1; rect.bottom -= 1; ScreenToClient(rect); dc.Draw3dRect(rect, RGB(255, 0, 0), RGB(255, 0, 0)); Invalidate(); Default(); } |