Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display Soft Input Panel (SIP) on WP7 programmatically

How can I programmatically display the soft input panel (SIP)/keypad, via code. (I dont have a text-box on which I can specify the InputScope).

like image 546
Raj Rao Avatar asked Oct 15 '10 03:10

Raj Rao


1 Answers

From Jeff Blankenburgs 31 Days of Windows Phone 7:

Sometimes, you want to get keyboard input from your user, even when you don’t want to present them with an actual TextBox. There’s probably plenty of ways around this, but I’ve been using a handy one that is simple to accomplish. (If you’re searching for a reason to do this, think of a game of Hangman. I don’t want the keyboard visible always, but I also don’t want a TextBox on the screen.)

Put a button on your page.

Put a TextBox on your page, but make sure it’s hidden from the user’s view.

Either position it off screen, make it completely transparent (and in the absolute background), or some other method that allows it to get added to your visual tree, but doesn’t let the user see it.

Set an event handler on your button that sets Focus() to the hidden textbox when it’s clicked.

That’s it! This will allow you to show the keyboard without the user seeing a textbox.seeing a textbox.

like image 65
Greg Bray Avatar answered Nov 15 '22 11:11

Greg Bray