小强提问?

chen1011 2005-07-22 11:53:37
在状态栏的窗格里怎样输出鼠标的坐标?请帮一下
...全文
96 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Alan S1 2005-08-03
  • 打赏
  • 举报
回复
// CTestView 消息处理程序
void CTestView::OnMouseMove(UINT nFlags, CPoint point)
{
CMainFrame *pWnd=(CMainFrame*)AfxGetMainWnd();
pWnd->m_wndStatusBar.SetPaneInfo(2,ID_SEPARATOR,SBPS_NORMAL,150);
CString StrInfo;
StrInfo.Format("鼠标当前位置:X=%002d:Y=%002d",point.x,point.y);
pWnd->m_wndStatusBar.SetPaneText(2,StrInfo);
CView::OnMouseMove(nFlags, point);
}
chen1011 2005-07-31
  • 打赏
  • 举报
回复
Up!!!
能详细一点吗???
快乐鹦鹉 2005-07-22
  • 打赏
  • 举报
回复
在鼠标移动事件中,调用:
CStatusBar* pStatus = (CStatusBar*)
AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_STATUS_BAR);
pStatus->SetPaneText(1,sLat+" "+sLong);

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧