Advertisement
calfred2808

Detecting Ctrl and Shift Keys on a Form using VB.NET

Jan 16th, 2014
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.39 KB | None | 0 0
  1. Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
  2.     If (e.Control And e.Shift) AndAlso e.KeyCode = Keys.C Then
  3.         MessageBox.Show("Ctrl+Shift+C")
  4.     ElseIf e.Control AndAlso e.KeyCode = Keys.C Then
  5.         MessageBox.Show("Ctrl+C detected")
  6.     ElseIf e.Control AndAlso e.KeyCode = Keys.V Then
  7.         MessageBox.Show("Ctrl+V detected")
  8.     End If
  9. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement