logo

Windows Phone 8.1 is already there for developers and developers already started building and/or upgrading their apps to support the new changes in Windows Phone 8.1. The RC version of Visual Studio 2013 Update 2 is already there with WP8.1 SDK preloaded.

 

In this post, we are going to discuss the enhanced TextBox control which came with additional features like place holder text, header content etc.

 

The TextBox control in Windows Phone 8.1 SDK supports setting Header text. You can also modify the header template to place explicit content and/or design it as per your need. This was asked by many developers to provide in the default control, as some third party libraries already provide this feature.

 

Also, it supports “Place Holder Text”, that means, you can now set Watermarked Text in your TextBox control. This was also part of some third party library vendors but was somehow missing in Windows Phone SDK. As these are now available directly in your default control, you can now use this without any additional cost or design efforts.

 

 

Windows Phone 8.1 - TextBox Control with Header and Custom Header (www.kunal-chowdhury.com)        Windows Phone 8.1 - TextBox Control with support to enable/disable Spell Checker (www.kunal-chowdhury.com)

 

Here is the code snippet for you to try out the additional features part of Windows Phone 8.1 SDK:

 

<StackPanel Margin="10">
    <TextBox Header="Header"/>
    <TextBox Header="Custom Header">
        <TextBox.HeaderTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding}" FontSize="18" Foreground="Yellow"/>
            </DataTemplate>
        </TextBox.HeaderTemplate>
    </TextBox>
    <TextBox Header="Spell Check Enabled" IsSpellCheckEnabled="True"/>
    <TextBox Header="Spell Check Disabled" IsSpellCheckEnabled="False"/>
    <TextBox Header="Text Prediction Enabled" IsTextPredictionEnabled="True"/>
    <TextBox Header="Text Prediction Disabled" IsTextPredictionEnabled="False"/>
    <TextBox Header="Place Holder Text" PlaceholderText="Watermarked text"/>
</StackPanel>

 

Additionally, you can also add/remove support for Spell Checker, Text Predictions etc. while using TextBox control in your apps or games. You can see below how the Spell Checker and Text Prediction works:

 

Windows Phone 8.1 - TextBox Control with Text Prediction enabled (www.kunal-chowdhury.com)        Windows Phone 8.1 - TextBox Control with Text Prediction disabled (www.kunal-chowdhury.com)

 

I hope, this small post will provide you some information about using the enhanced TextBox control in your Windows Phone 8.1 apps or games. I am going to share out some more information on the other controls as and when I explore them. Till that time, happy reading and keep exploring.

 

Don’t forget to connect with me on Twitter, Facebook and Google+ to get my updates. Subscribe to my blog’s RSS feed and/or email newsletter to get the immediate update about my posts. Any queries, let me know and I will try to reply you as soon as I can after my busy schedule.

 

Have a question? Or, a comment? Let's Discuss it below...

dhgate

Thank you for visiting our website!

We value your engagement and would love to hear your thoughts. Don't forget to leave a comment below to share your feedback, opinions, or questions.

We believe in fostering an interactive and inclusive community, and your comments play a crucial role in creating that environment.