Divya
Divya

Reputation: 2622

Overriding <Enter> key behaviour in Windows Phone 7.1

I'm developing an app for Windows Phone 7.1. I was wondering if it is possible to override the behaviour of the enter button on the virtual keyboard. Basically, I want the user to be able to submit the form if he/she presses the enter button when filling the last field of the form. Please let me know if it is possible or if the convention is not to do so.

Thanks.

Upvotes: 3

Views: 450

Answers (1)

Ku6opr
Ku6opr

Reputation: 8126

There is event OnKeyDown for this purpose

 textblock.OnKeyDown += (s, e) =>
 {
      if (e.Key = Key.Enter)
      {
           //do your stuff here
      }
 };

Upvotes: 3

Related Questions