I have tried different solutions given here for the question, but couldn't seem to get around it. I want to detect Shift Ctrl C in a KeyDown
event in VB.Net.
The KeyPreview
property is set to true for my form.
What I tried is:
If e.Modifiers = (Keys.Shift And Keys.Control) And e.KeyCode = Keys.C Then
'do the action
End If
Any help would be much appreciated!
The comment to your question is correct:
If (e.KeyCode = Keys.C AndAlso e.Modifiers = (Keys.Control Or Keys.Shift)) Then
'Do what you want here
End If
If you would like this to happen anywhere on your form, you need to put the KeyPreview
of your Form
to True
.
You can then put it in the Form_KeyDown
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.