当两个以上的快捷键按下时,才执行后面程序?这一个条件(两个以上的快捷键同时按下)怎么写?比喻:if alt+ins then
              '按行语句
      end if

解决方案 »

  1.   

    if 条件1 and 条件2 thenend if
      

  2.   


    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
        If Key = 18 Xor KeyCode = 45 Then
            MsgBox "Wow!"
        End If
        Debug.Print KeyCode
    End SubPrivate Sub Form_Load()
        Me.KeyPreview = True
    End Sub
      

  3.   

    Key = 18 Xor KeyCode = 4518是alt的KeyCode值
    45是Insert的Keycode值
      

  4.   

    Public key As Integer
    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
        If key = 18 And KeyCode = 45 Then
            MsgBox "Wow!"
        End If
        key = KeyCode
        Debug.Print KeyCode
    End Sub