Windows Phone 7 textbox all-selected extension Behavior

Source: Internet
Author: User
Tags visual studio 2010

We may encounter such a situation on the web, that is, when you modify the value of a text (such as input type = "text" in HTML), when the text is focused, all the text is selected to facilitate modification without the need to delete and modify it one by one.

Similarly, we can apply it to the textbox of WP7. We can create a custom behavior to Control. When the textbox is attached with this row, when the textbox is focused, all text in textbox is selected. If you are confused about how to create custom behaviors, refer to the two articlesArticleCreate a custom behavior and use it in a Silverlight project, and create a custom behavior and use it in a Silverlight project.

I onlyCodeAfter you paste it out, we will not describe it in detail step by step. You can use Visual Studio 2010 or expression blend to create an action. The above two articles describe it.

Textboxselectallonfocusbehavior. CS code

 

If you use vs to create a behavior, do not forget to add a namespace when calling the behavior. For details, refer to the followingSource code. Let's take a look at the running effect.

 

Source code download:

Reference

Http://mark.monsterconsultancy.nl/2011/04/13/silverlight--windows-phone-7-behavior-to-enhance-usability-of-textboxes? Utm_source = feedburner & utm_medium = feed & utm_campaign = feed: + markmonster + (Mark + monster)

 

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.