When I doubleclick in Static Control, I will draw ellipse in Static Control in the position of mouse.(MFC); But, It apears that:
And My code:
void CTreeShowLabel::OnLButtonDblClk(UINT nFlags, CPoint point)
{
//设置画笔
COLORREF black = RGB(255, 0, 0);
CPen pen(PS_SOLID, 1, black);
CClientDC Dc(GetDlgItem(IDC_TREESTATIC));
Dc.SelectObject(pen);
//在鼠标处画图
CPoint curPos;
GetCursorPos(&curPos);
CPoint point1(0,0);
point1.x = curPos.x - 50;
point1.y = curPos.y - 50;
CPoint point2(0,0);
point2.x = curPos.x + 50;
point2.y = curPos.y + 50;
//画圆
Dc.Ellipse(CRect(point1, point2));
CStatic::OnLButtonDblClk(nFlags, point);
}
About the Circle is terrible.