What's new

.NET [VB.NET] Disable Windows shortcut keys from working in your application

1

1_UP

Enthusiast
Messages
10
Reaction score
6
Points
60
Sin$
7
I am currently writing some software that will for the most part work like a Kiosk in that it will be the only program able to re ran. There were a few things I wanted to make certain and one of those was not allowing the user to break out of the program. One of the first things that came to mind was disabling the use of ALT + F4.

It's pretty simple to implement.


Code:
  Private Sub testForm_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
  If e.Modifiers = Keys.Alt And e.KeyCode = Keys.F4 Then
  e.Handled = True
  End If
  End Sub
 
JTAGUK

JTAGUK

Extreme Contributer
Messages
66
Reaction score
27
Points
70
Sin$
0
Sweet! I could implement this into my current little project, it could make it useful.
 
Top Bottom
Login
Register