I want to hide the soft keyboard when the Enter key is pressed, but no solutions work for me correctly. (Windows Phone 8.1 Universal App)
This just doesn't work:
if (e.Key == VirtualKey.Enter) { textBox.IsEnabled = false; textBox.IsEnabled = true; }
A method like this:
private void LoseFocus(object sender) { var control = sender as Control; var isTabStop = control.IsTabStop; control.IsEnabled = false; control.IsTabStop = false; control.IsEnabled = true; control.IsTabStop = isTabStop; }
only works partially. This only hides the keyboard when I use the text box for the first time. The second time the keyboard appears again.
source share