views:

22

answers:

1

This code should fire when is pressed, but not +. What change do I need to make it work correctly?

Private Sub cmdDeleteRow_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Input.KeyEventArgs)
    If e.Key = Input.Key.Tab Then
        'DO stuff
    End If
End Sub
+2  A: 

Hmh, yor question title doesn't match the content (no reference to the shift key)!

Are you trying to avoid "Do stuff" when Shift+Tab is pressed? If so you need to check the modifier keys, whether Shift is pressed or not. I don't know the exact code for vb.net (you can easily google for it), but in c# there's a Keyboard.Modifiers property that can be accessed...

Marko
I can't believe I missed that. I could have sworn I looked for a property with that name first.
Jonathan Allen