How to get Enter key event in windows phone 8.1

Rahul Kiwitech
Rahul K...
Participant
100 Points
40 Posts

I am new in Window phone development. I trying to catch enter key event as

<TextBox x:Name="txtMessage" KeyDown="txtMessage_Enter"/>

but not working

private void txtMessage_Enter(object sender, KeyRoutedEventArgs e) {
//always fired
}

how to find the specific enter key?

Views: 8180
Total Answered: 1
Total Marked As Answer: 0
Posted On: 11-Jun-2016 21:59

Share:   fb twitter linkedin
Answers
NiceOne Team
NiceOne...
Admin
404 Points
67 Posts
         

You are doing right. Just put the key filter into the event as

private void txtMessage_Enter(object sender, KeyRoutedEventArgs e) {
if (e.Key == Windows.System.VirtualKey.Enter) {
// do anything here
}
}

 

Posted On: 11-Jun-2016 22:03
 Log In to Chat