Windows Phone 7 Development discussion on the 31st day-10th: input range and text box

Source: Internet
Author: User

This article is about Windows Phone 7 development on the 31st day"10th day of the series.

This article focuses on Windows Phone 7 keyboards. I will explain how to use the keyboard to display the characters you want. We will also discuss passwordbox and how to customize them.ArticleFinally, it containsCodeExample.

Superb simulator skills

I have heard many people complain that they cannot use a keyboard to develop Windows Phone 7 applications.Program. They can only click every button on the keyboard, which reduces their development and testing efficiency. Here is an easy way to use your computer keyboard. Press on your computer keyboardPause/breakKey.It allows you to switch between the screen keyboard of the simulator and the physical keyboard of the computer.

Inputscope)

Each text box and Password box can assign values to the input range. This is not necessary, but they can make the user feel more friendly. For example, the following two are Windows Phone 7 keyboards:

Obviously they are not the same keyboard. You only need to do something to make them appear. Below is the XAML code for making the two text boxes pop up the above keyboard:

< Textbox height = " 100 "   />
< Textbox inputscope = " Telephonenumber " Height = " 100 "   />

By using the inputscope attribute, we can give users the most appropriate keyboard to meet their needs. For example, if we need to enter a phone number, it is not appropriate to bring up a letter keyboard. The following lists some other values:

URL

This keyboard provides you with a ". com" button to complete the URL input. If you press that key long, it will expand and show you. net,. org,. edu. Very convenient.

Number

This input range value skips the letter keyboard and provides a standard numeric keyboard.

Text

At the bottom, you will see an exquisite smiling face. Click it and you will see a lot of emojis, the perfect shot for sending text messages!

Telephonenumber

This is one of the examples above. A number dial instead of a letter keyboard is provided for users.

Emailnameoraddress

When writing an email, we usually do three things. A prefix, A @ symbol, and a top-level domain, such as. com or. NET. In this input range value, the keyboard already contains all this content.

Make smart sensing work

You may notice that there is no list of available input range values when you type inputscope = "in the text box. If you make minor adjustments in the syntax (which may be slightly longer), you can see the entire list. Do as follows:

< Textbox Height = "75" >
< Textbox. inputscope >
< Inputscope >
< Inputscopename Namevalue = "Bopomofo"   />
</ Inputscope >
</ Textbox. inputscope >
</ Textbox >

You may be curious,Phonetic symbolsIt is an official Chinese pronunciation system in full time, but this article will not go into this unused word. The following is the value of the input range that you can see in Intelligent Sensing:

Use the code to start the Windows Phone 7 keyboard

Sometimes you want your users to enter information, but you do not want to present them with an actual text box. There are many ways to achieve this, but I like to use the most convenient one. (If you are searching why you want to do this, think about the hangman game. I don't want to display the keyboard, but I don't want to place a text box on the screen .)

    1. Place a button on the page.
    2. Place a text box on the page, but make sure that it is not displayed in any position on the screen outside the user's sight, set it to completely transparent (set as absolute background ), or add it to the visual tree in other ways, but do not let the user see it.
    3. Add a click event handler on the button. When it is clicked, the focus method is used to assign the focus to the hidden text box.
    4. Okay! This allows you to expand the keyboard without seeing the text box.

The following code example contains this example.

Password box

There is no need to say too much in the password box, but there are some minor issues that I think you should know.

First, when you press the keyboard until it turns into an obscure symbol, there will be a latency of 1 to 2 seconds. You must have encountered this situation before, but you may have never thought about it. For example, if you enter characters in your browser and they change to dots or asterisks.

Second, you can set these "obscure characters "! If you like to use question marks or specific font characters, it is okay. You only need to specify the passwordchar attribute. Let's take a look:

< Passwordbox X: Name = "Passbox" Passwordchar = "? "   />

 Sample Code for the input range, text box, and password box

Tomorrow, we will talk about the accelerator and how to collect data from the excellent sensor in the device.

Address: http://www.jeffblankenburg.com/post/31-Days-of-Windows-Phone-7c-Day-10-InputScope-TextBoxes.aspx

 

If you like my article, click "recommendation ", Thank you!

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.