3
votes

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.

1
I have seen plenty of apps that have this as a convention, so I'm guessing it's possible (I just don't know how to do it).DaveShaw
Thanks DaveShaw. I wanted to make sure that I'm not the first person doing this. :)Divya
@Divya check out InputScope too - I believe the Search inputscope makes the return button a different color than the rest of the keyboard, so it will be easier for users to tell it has submit functionality. imaginativeuniversal.com/blog/post/2010/07/06/…William Melani

1 Answers

3
votes

There is event OnKeyDown for this purpose

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