Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open numeric only keyboard in Windows Phone?

How can i set the keyboard to open in number mode or directly open a special numeric keyboard (as in android)??? My goal is to avoid the user to press the little button to toggle letters and numbers everytime before entering the value that may only be a numerical value. I have a textbox that the user needs to edit.Thanks!!!!

like image 967
Cippo Avatar asked Mar 13 '12 19:03

Cippo


1 Answers

Set the InputScope to Number.

XAML

<TextBox InputScope="Number" Name="txtPhoneNumber" />

C#

InputScope scope = new InputScope();
InputScopeName name = new InputScopeName();

name.NameValue = InputScopeNameValue.Number;
scope.Names.Add(name);

txtPhoneNumber.InputScope = scope;

Above code snippets taken from this MSDN article which you can review for more information. As Martin added in the comment, you can also see screenshots of the different InputScope options here.

like image 109
David Ruttka Avatar answered Oct 08 '22 10:10

David Ruttka