I've got a WP7 app where I need to enter large numeric data (6 digits and more) - is there some kind of advanced numeric control to enter large numbers comfortably?
+2
A:
By comfortably, do you mean the keyboard that comes up? Or that you don't want to use a keyboard at all?
In Silverlight, I believe that one way to set the type of keyboard is set the scope of the input for the TextBox... so in XAML:
<TextBox InputScope=”Number” …/>
or for a phone keypad
<TextBox InputScope=”TelephoneNumber” …/>
Chris Gomez
2010-10-21 18:35:39
I didn't think about the keyboard, more about something like the datepicker where you can slide individual sets onscreen.
Sam
2010-10-22 06:14:45
But to be able to set the inputscope is a great start in general, thanks!
Sam
2010-10-22 06:15:11
A:
Hi Sam,
Further to Chris' suggestion to use TelephoneNumber input scope, you might also consider trimming out any unwanted entry from keys you don't want to allow, like # for example.
Some code to demonstrate:
private void textBox1_TextChanged(object sender, TextChangedEventArgs e)
{
if (textBox1.Text.Contains("#"))
{
var s = textBox1.SelectionStart;
textBox1.Text = textBox1.Text.Replace("#", "");
textBox1.SelectionStart = s-1;
}
}
Mick N
2010-10-22 00:37:25