Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to hide soft keyboard in WP7?

In a TextBox input. After type enter key, i want to hide soft keyboard. How to do it in codes?

private void OnKeyDownHandler(object sender, KeyEventArgs e)
           {
                if (e.Key != Key.Enter)
                   return;         

...}
like image 776
whi Avatar asked Nov 28 '22 12:11

whi


1 Answers

this.focus() This will allow the focus to be lost from the textbox. It basically puts the focus on the page instead. You could also convert your textbox to read only to disallow any further input.

Hiding the SIP can be done by simply changing the focus from the textbox to any other element on the page. It does not have to be this.focus(), it could be anyElement.focus(). As long as the element is not your textbox, the SIP should hide itself.

like image 109
abhinav Avatar answered Dec 18 '22 10:12

abhinav