The Key event support multiple key presses such as the Control and Alt keys, plus another key. Key combinations other than that are not accessible.
In this example the state of the Left and Up keys are sensed to detect when they are both active (pressed). This can be extended to any number of keys.
Code:Private Declare Function GetAsyncKeyState Lib "user32" (ByVal keyCode As Integer) As Integer Private Sub DetectKeys() If GetAsyncKeyState(Keys.Left) And GetAsyncKeyState(Keys.Up) Then _ TextBox1.Text = "Yes" Else TextBox1.Text = "No" End Sub Private Sub Form1_KeyDown(ByVal sender As System.Object, _ ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown DetectKeys() End Sub Private Sub Form1_KeyUp(ByVal sender As System.Object, _ ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp DetectKeys() End Sub




Reply With Quote