Sub Macro1() 'Macro crée BLABLA 'raccourci CTRL+E Usf.Show End Sub
Private Declare Function GetKeyState Lib "user32.dll" (ByVal nVirtKey As Long) As Integer Private Const VK_SHIFT As Long = &H10 Private Const VK_CONTROL As Long = &H11
Public Function ToucheControlEnfoncée() As Boolean If GetKeyState(VK_CONTROL) = -127 Or _ GetKeyState(VK_CONTROL) = -128 Then ToucheControlEnfoncée = True Else ToucheControlEnfoncée = False End If End Function
if KeyCode = KeyCodeConstants.vbKeyE And ToucheControlEnfoncée Then
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question'On intercepte les évènements clavier pour les raccourci CTRL + x Me.KeyPreview = True
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown 'Si la touche contrôle est enfoncée ainsi que la touche A ... If e.Control True And e.KeyCode Keys.A Then 'affichage du formulaire Form4.Show() End If End Sub