16. February 2011 01:17
/
jstawski
/
Comments (7)
I was looking for a way to programmatically hide the keyboard in WP7 and was searching for some WP7 API method, but couldn’t find one. Then it dawn on me that the keyboard automatically hides when the TextBox control looses focus. So I decided to give it a try by setting the focus on another control and it worked:
1: //focus the current page
2: this.Focus();
3: //or focus another control
4: ListBox1.Focus();
It is very easy and straight forward. This is very nice trick for when you use the enter button of the keyboard to emulate a button click, like in a search box.
Happy programming!
b29faf4f-b514-49ae-ae58-cb4f38a142f1|5|3.0|27604f05-86ad-47ef-9e05-950bb762570c