Public Const VK_CONTROL = &H11
Public Const KEYISDOWN = &HF0000000case (GetKeyState(VK_CONTROL) And &HF0000000) And wParam = Asc("V")
......为什么这样不能检测到Ctrl + v这个键??

解决方案 »

  1.   

    wparam是什么,为什么不用if语句,括号也不对,asc("v")只是v的ascii码,不是^v的
      

  2.   

    if GetKeyState( VK_CONTROL ) < 0 and wParam = Asc("V" )
      

  3.   

    首先设置form的keypreview=true,然后这样就搞定了Option Explicit
    Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
    Private Const VK_CONTROL = &H11Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
        If GetKeyState(VK_CONTROL) < 0 And KeyCode = Asc("V") Then
            Debug.Print "fdsa"
        End If
    End Sub