I have textbox catching KeyDown events like this:
<Style TargetType="TextBox">
<EventSetter Event="KeyDown" Handler="TextBoxInput"/>
</Style>
It works for all key and key combinations except spacebar. Even space with modifiers works ok, only space alone does not come to my method.
Is there anything I can change on the textbox to fire the event also on spacebar alone?
Use the
PreviewKeyDownevent instead ofKeyDown.And you can use this article as backing for that.