标签:blog pos nbsp targe 桌面 windows dev win 位置
原文:WPF中获取鼠标相对于桌面位置var transform = PresentationSource.FromVisual(this).CompositionTarget.TransformFromDevice; var mouse = transform.Transform(GetMousePosition()); public System.Windows.Point GetMousePosition() { System.Drawing.Point point = System.Windows.Forms.Control.MousePosition; return new System.Windows.Point(point.X, point.Y); }
或者用PointToScreen
标签:blog pos nbsp targe 桌面 windows dev win 位置
原文地址:https://www.cnblogs.com/lonelyxmas/p/9473626.html