Re: [VB6 ] 座標問題
以下是可以抓滑鼠位置的程式.邊框部份請自己找API
Option Explicit
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Timer1_Timer()
Dim xy As POINTAPI
GetCursorPos xy
xy.x = xy.x - Me.Left / Screen.TwipsPerPixelX
xy.y = xy.y - Me.Top / Screen.TwipsPerPixelY
Label1.Caption = CStr(xy.x) & " : " & CStr(xy.y)
End Sub
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 202.145.53.109
推
11/21 09:27, , 1F
11/21 09:27, 1F
討論串 (同標題文章)
Visual_Basic 近期熱門文章
PTT數位生活區 即時熱門文章