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.

Add comment

I am a husband, father of three and a Microsoft Most Valuable Professional (MVP) and a Microsoft Certified Application Developer (MCAD) with over a decade of experience building and architecting .NET applications and even more years of professional experience using Microsoft development technologies such as ASP, Visual Basic, and SQL Server. I have worked in several markets such as insurance, real estate, leasing, medical, hospitality, among many others.