I don't think you'll be able to do it with Ctrl+Alt because you can't detect consecutive KeyDown events for different keys with the Alt key down. This works with Ctrl+Shift. Set the form's KeyPreview property to True and:VB Code:
Private jDown As Boolean = False 'Whether the J key is depressed. Private nDown As Boolean = False 'Whether the N key is depressed. Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown If e.KeyCode = Keys.J Then Me.jDown = True ElseIf e.KeyCode = Keys.N Then Me.nDown = True End If If e.Control AndAlso e.Shift AndAlso Me.jDown AndAlso Me.nDown Then MessageBox.Show("Coded by Justin Nel") End If End Sub Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp If e.KeyCode = Keys.J Then Me.jDown = False ElseIf e.KeyCode = Keys.N Then Me.nDown = False End If End Sub




Reply With Quote