-
Hi everyone. How are we all today?
I have this form that I want the user to deal with before they can do anything with Windows (it traps the mouse to the form and I'm trying to get it to trap keyboard shortcuts). They have to supply a password to "unlock" the mouse/keyboard.
I'm using this code to stop them using keyboard shortcuts, it all works except the ALT+TAB one.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
ShiftDown = (Shift And vbShiftMask) > 0
CtrlDown = (Shift And vbCtrlMask) > 0
Altdown = (Shift And vbAltMask > 0)
If CtrlDown And KeyCode = vbKeyEscape Then
KeyCode = 0
ElseIf Altdown And KeyCode = vbKeyTab Then
KeyCode = 0
ElseIf Altdown And KeyCode = vbKeyF6 Then
KeyCode = 0
ElseIf Altdown And KeyCode = vbKeyF4 Then
KeyCode = 0
End If
End Sub
Can anyone spot anything wrong? I can't! Is Windows cheaky and not allow you to stop the use of ALT+TAB?
Whilst I'm here, are there any other keyboard shortcuts that I haven't coded for?
Many thanks to all (esp. those who assist :))
Regards,
------------------
- Chris
[email protected]
If it ain't broke - don't fix it :)
-
I don't know if it makes a difference, but the right parenthesis in Altdown = (Shift And vbAltMask > 0) is placed differently than the others.
------------------
Marty
-
So it is - I hadn't noticed! Thank you - i'll give it a shot.
Kind regards,
------------------
- Chris
[email protected]
If it ain't broke - don't fix it :)
-
unfortunately - it didn't make any difference (typical!!). Any ideas anyone?!
Thanks,
------------------
- Chris
[email protected]
If it ain't broke - don't fix it :)