代码之家  ›  专栏  ›  技术社区  ›  Wahid Bitar

将鼠标放置在窗体上的最佳方法是什么?

  •  4
  • Wahid Bitar  · 技术社区  · 16 年前

    我想要获得Form鼠标位置的最佳方法。

    非常感谢

    2 回复  |  直到 15 年前
        2
  •  0
  •   Tunaki    10 年前
    xm=System.Windows.Forms.Cursor.Position.X - this.Location.X
    ym=System.Windows.Forms.Cursor.Position.Y - this.Location.Y
    

    那么你应该这样做:

    xm - form border x 
    ym - form border y
    
    推荐文章