谢谢。

解决方案 »

  1.   

    try this waydim p as pointapi
    GetCursorPos p
    p.x = p.x - thatwindow.left
    ....
      

  2.   

    鼠标?
    private sub form_mousemove(..,..,..x,..y)
    debug.print x
    debug.print y
    end sub
      

  3.   

    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)End Sub
      

  4.   

    三个函数:ScreenToClient VB声明 
    Declare Function ScreenToClient Lib "user32" Alias "ScreenToClient" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long 
    说明 
    判断屏幕上一个指定点的客户区坐标 
    返回值 
    Long,非零表示成功,零表示失败 
    参数表 
    参数 类型及说明 
    hwnd Long,一个窗口的句柄,该窗口定义了要使用的客户区坐标系统 
    lpPoint POINTAPI,屏幕坐标系统中包含了屏幕点的结构。这个函数会随同相应的客户区坐标(由hwnd决定)载入结构 Top
    ClientToScreen VB声明 
    Declare Function ClientToScreen Lib "user32" Alias "ClientToScreen" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long 
    说明 
    判断窗口内以客户区坐标表示的一个点的屏幕坐标 
    返回值 
    Long,非零表示成功,零表示失败 
    参数表 
    参数 类型及说明 
    hwnd Long,判断客户区坐标时那个窗口的句柄 
    lpPoint POINTAPI,用hwnd窗口的客户区坐标表示的点,这个参数会包含屏幕坐标系统中相同的点 Top
     
     etCursorPos VB声明 
    Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long 
    说明 
    获取鼠标指针的当前位置 
    返回值 
    Long,非零表示成功,零表示失败。会设置GetLastError 
    参数表 
    参数 类型及说明 
    lpPoint POINTAPI,随同指针在屏幕像素坐标中的位置载入的一个结构 Top
     
      

  5.   

    键盘光标还是鼠标???如果是鼠标用API:ScreenToClient