16,466
社区成员
发帖
与我相关
我的任务
分享
//全局变量
int xx=0,yy=0;
bool n=false;
//鼠标按下消息
void CrrrrrrrrrrrrrrrrrrrrrrView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
xx=point.x;
yy=point.y;
n=true;
Invalidate();
CView::OnLButtonDown(nFlags, point);
}
//view类
void CrrrrrrrrrrrrrrrrrrrrrrView::OnDraw(CDC* pDC)
{
CrrrrrrrrrrrrrrrrrrrrrrDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
// TODO: 在此处为本机数据添加绘制代码
if(n==true)
{
pDC->TextOutA(xx,yy,"点击这里了");
}
}