以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  GetCursorPos【获当前鼠标位置】如何实现  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=39776)

--  作者:打错潇洒
--  发布时间:2013/9/1 14:41:00
--  GetCursorPos【获当前鼠标位置】如何实现


Private Declare Function GetCursorPos Lib "user32" (lpPoint As PointAPI) As Long

Private Type PointAPI
      X As Long
      Y As Long
End Type

使用:

Dim ScreenPoint As PointAPI
GetCursorPos ScreenPoint




网络上找的。狐表里面不会用 求助各位大神

[此贴子已经被作者于2013-9-1 14:42:00编辑过]

--  作者:菲舍尔
--  发布时间:2013/9/1 14:59:00
--  

在窗口的鼠标事件中可以得到鼠标的位置

 


--  作者:打错潇洒
--  发布时间:2013/9/1 15:02:00
--  
我要的是屏幕 不是窗口。我要得到鼠标在屏幕上的位置
--  作者:逛逛
--  发布时间:2013/9/1 15:17:00
--  

窗口的 计时器 设为真

TimerTick 里输入代码

 

变量或展示控件的值X = System.Windows.Forms.Cursor.Position.X.ToString()

 

变量或展示控件的值Y = System.Windows.Forms.Cursor.Position.Y.ToString()

 

图片点击可在新窗口打开查看想做窗体的自动隐藏?

[此贴子已经被作者于2013-9-1 15:17:17编辑过]

--  作者:菲舍尔
--  发布时间:2013/9/1 15:19:00
--  
得到窗口鼠标的位置,可以转换成屏幕位置的