Reputation: 1
When I press the Escape key I want to move the focus to the previous control.
How can I achieve this?
Upvotes: 0
Views: 237
Reputation: 402
When you get focus on a control, log the control in a stack so you can always retrieve the previously focussed control.
Next use a keydown eventhandler on the controls and check for the escape key. If escape key is pressed, set focus to the top control in the stack.
Upvotes: 1