Point pointToWindow = Mouse.GetPosition(this);
Point pointToScreen = PointToScreen(pointToWindow);
this.Xtext.Text = pointToScreen.X.ToString();
this.Ytext.Text = pointToScreen.Y.ToString();
用到的是这个方法 Visual.PointToScreen Method (Point)
参考:https://msdn.microsoft.com/en-us/library/system.windows.media.visual.pointtoscreen.aspx
网友评论