mfc(C对话框):
//CImgView.cpp:
void CImgView::OnMouseMove(UINT nFlags, CPoint pt)
{
CPoint ptImg = GetScrollPosition() + pt;
sprintf(sbuf,"X %d Y %d", ptImg.x, ptImg.y);
((CImgDlg*)GetParent())->Update1();
CScrollView::OnMouseMove(nFlags, pt);
}
//CImgDlg.cpp:
void CImgDlg::Update1()
{
SetDlgItemText(IDC_STATIC_xy, sbuf);
}
静态文本 IDC_STATIC_xy 不会更新。