Question

I have an application where user is adviced to write numbers only in a textBox. However, on textBox GotFocus-attribute I end up with a regular keyboard. How can I change this to phone dialer input, or a number-only input?

        <TextBox 
        Grid.ColumnSpan="2" 
        Grid.Row="3"
        Grid.Column="0"
        FontSize="80"
        FontWeight="Bold"
        Height="130" 
        HorizontalAlignment="Center"
        Width="200"
        Margin="0,0,0,0" 
        Name="userAnswer" 
        Text="" 
        TextAlignment="Center"
        VerticalAlignment="Stretch"
        GotFocus="userAnswer_GotFocus"
        Background="White"
        Foreground="Black"            
        />
Was it helpful?

Solution

You need to use the InputScope attribute:

InputScope="TelephoneNumber"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top