3

I'm using an autocomplete box and I'd like to remove the focus from the autocomplete box when I press enter on the keyboard.

I tried using the OnKeyDown method but it won't detect the enter key being pressed (it detects all other keys).

How can I detect the user pressing the enter key?

Thanks!

1 Answer 1

2

Fortunately I solved it! (I feel a bit stupid for asking the question now).

Turns out that although OnKeyDown works for most controls, in order to detect the enter key being pressed when using an autocomplete control, you need to use OnKeyUp.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.