Gopinath Perumal
Gopinath Perumal

Reputation: 2328

How do always display the Numeric keyboard in windows phone 8?

I'm working on windows phone 8 app, I had a page which inputs number for that I gave code like this,

<TextBox Name="txtNumber" Height="Auto" Margin="0,10,0,510" >
    <TextBox.InputScope>
        <InputScope>
            <InputScopeName NameValue="Number" />
        </InputScope>
    </TextBox.InputScope>
</TextBox>

by the above code; It display the numeric keyboard when I place the cursor to type; But I need a fixed keyboard which is always visible and if we type it has to enter the value to the textbox.

Would somebody please tell me how to do that.

Upvotes: 2

Views: 6452

Answers (2)

user1593950
user1593950

Reputation:

Try this on for size:

Xaml:

<Grid 
    x:Name="ContentPanel" 
    Grid.Row="1" 
    Margin="12,0,12,0"
    Loaded="ContentPanel_Loaded">
    <TextBox 
        Name="TB1" 
        HorizontalAlignment="Left" 
        Height="72" 
        Margin="0,74,0,0" 
        VerticalAlignment="Top"
        Width="456"
        InputScope="Number"/>
</Grid>

Code:

private void ContentPanel_Loaded(object sender, RoutedEventArgs e)
{
    // Turn on Tab Stops.  You can set this in XAML as well.  
    this.IsTabStop = true;

    // Set focus on the TextBox.
    TB1.Focus();
}

It will spark up the SIP as it enters the <TextBox> ready for input. Hope it's what your looking for.

Got it from this MSDN blog.

Upvotes: 5

robertk
robertk

Reputation: 2461

The easiest way would probably be with creating your own user control. However it is most likely a lot of work to get it to work as a normal keyboard. http://www.silverlightshow.net/items/Creating-a-Silverlight-Custom-Control-The-Basics.aspx

Or maybe perhaps this will help http://www.silverlightshow.net/items/Windows-Phone-7-Creating-Custom-Keyboard.aspx

Upvotes: 1

Related Questions