Svenrutten
asked on
check if Ctrl-Key is pressed...
Hello
My problem is the following:
I want that if I press the CTRL-Key that label1 should show "Multiple Selection possible"
I have this code:
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEv entArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.ControlKey Then
Label1.Text = "Multiple Selection possible"
End If
End Sub
And that is working but if I place a textbox on the form and the textbox has focus it is not working anymore...
I know that I could code this for every textbox too but can I not use this as main Form event which is overriding all other inputs?
Thanks a lot
Sven
My problem is the following:
I want that if I press the CTRL-Key that label1 should show "Multiple Selection possible"
I have this code:
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEv
If e.KeyCode = Keys.ControlKey Then
Label1.Text = "Multiple Selection possible"
End If
End Sub
And that is working but if I place a textbox on the form and the textbox has focus it is not working anymore...
I know that I could code this for every textbox too but can I not use this as main Form event which is overriding all other inputs?
Thanks a lot
Sven
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER