wpf获取鼠标的位置-------WPF

1.相对于屏幕的位置 :System.Windows.Forms.Control.MousePosition.X;

2.相对于主窗体的位置  :Mouse.GetPosition(null);

3.相对于某个控件的位置Mouse.GetPosition(控件对象);

4.设置窗体的绝对位置

ReportMessageBox reportmessage = new ReportMessageBox();-----------窗体

reportmessage.Left = System.Windows.Forms.Control.MousePosition.X;-------设置窗体的x坐标的绝对位置

 

posted on 2015-12-03 15:13  你的乐哥哥  阅读(2466)  评论(0编辑  收藏  举报