如果不嫌麻烦的话,可以这样:
1、读取窗体内部宽度W1、高度H1。
2、获取当前屏幕分辨率Xp、Yp。
3、读取需要跳转的X、Y坐标。
4、X1=(W1/Xp)*x
5、求的Y1
6、执行光标设置命令,就可以设置到你窗体的指定位置了
Option Explicit
Private Declare Function SetCursorPos Lib "user32" ( _
ByVal x As Long, _
ByVal y As Long _
) As Long
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Const MOUSEEVENTF_LEFTDOWN = &H2
Private Const MOUSEEVENTF_LEFTUP = &H4
Private Sub Command1_Click()
SetCursorPos Text1.Text +Me.left\15, Text2.Text+me.top\15
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
End Sub
我不知道写代码,不过用录制的办法,又快又好啊