Private Sub Picture1_DblClick()
    '  坐标是啥呢?
End Sub

解决方案 »

  1.   

    Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Debug.Print X & "/" & Y
    End Sub
      

  2.   

    不要写MouseDBClick事件,请写:MouseDown事件
      

  3.   

    '在鼠标单击时获取坐标
    Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        'X:坐标X;Y:坐标Y
    End Sub
      

  4.   


    Private Type POINTAPI
        X As Long
        Y As Long
    End Type
    Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
    Private Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As LongPrivate Sub Picture1_DblClick()
        Dim pt As POINTAPI, pt2 As POINTAPI
        Dim cx As Long, cy As Long
        If GetCursorPos(pt) Then
            pt2 = pt
            Debug.Print "当前鼠标相对屏幕坐标: " & pt.X & "," & pt.Y; " 像素."
            If ScreenToClient(Form1.hWnd, pt) Then
                Debug.Print "当前鼠标相对窗体坐标: " & pt.X & "," & pt.Y; " 像素."
                cx = Form1.ScaleX(pt.X, vbPixels, vbTwips)
                cy = Form1.ScaleY(pt.Y, vbPixels, vbTwips)
                Debug.Print "当前鼠标相对窗体坐标: " & cx & "," & cy; " 缇."
            End If
            If ScreenToClient(Picture1.hWnd, pt2) Then
                Debug.Print "当前鼠标相对图片框坐标: " & pt2.X & "," & pt2.Y; " 像素."
                cx = Picture1.ScaleX(pt2.X, vbPixels, vbTwips)
                cy = Picture1.ScaleY(pt2.Y, vbPixels, vbTwips)
                Debug.Print "当前鼠标相对图片框坐标: " & cx & "," & cy; " 缇."
            End If
        End If
    End Sub