变换莫测的TextBox 可实现数字键盘、字母键盘、组合键盘

一些控件(TextBox、PassWordBox等)中,有这个属性可以让软键盘产生不同的键面效果,以利于输入。

以下是这个属性支持的Scope列表:

      1.   AddressCity
2. AddressCountryName
3. AddressCountryShortName
4. AddressStateOrProvince
5. AddressStreet
6. AlphanumericFullWidth
7. AlphanumericHalfWidth
8. ApplicationEnd
9. Bopomofo
10. Chat
11. CurrencyAmount
12. CurrencyAmountAndSymbol
13. CurrencyChinese
14. Date
15. DateDay
16. DateDayName
17. DateMonth
18. DateMonthName
19. DateYear
20. Default
21. Digits
22. EmailNameOrAddress
23. EmailSmtpAddress
24. EmailUserName
25. EnumString
26. FileName
27. FullFilePath
28. Hanja
29. Hiragana
30. KatakanaFullWidth
31. KatakanaHalfWidth
32. LogOnName
33. Maps
34. NameOrPhoneNumber
35. Number
36. NumberFullWidth
37. OneChar
38. Password
39. PersonalFullName
40. PersonalGivenName
41. PersonalMiddleName
42. PersonalNamePrefix
43. PersonalNameSuffix
44. PersonalSurname
45. PhraseList
46. PostalAddress
47. PostalCode
48. Private
49. RegularExpression
50. Search
51. Srgs
52. TelephoneAreaCode
53. TelephoneCountryCode
54. TelephoneLocalNumber
55. TelephoneNumber
56. Text
57. Time
58. TimeHour
59. TimeMinorSec
60. Url
61. Xml
62. Yomi

可以通过代码来获取上面的列表:

FieldInfo[] array = typeof(InputScopeNameValue).GetFields(BindingFlags.Public |BindingFlags.Static);

 

            <TextBox Height="72" HorizontalAlignment="Left" Margin="64,234,0,0" Name="textBox1" Text="Text" VerticalAlignment="Top" Width="335">
                <TextBox.InputScope>
                    <InputScope>
                        <InputScopeName NameValue="Text"></InputScopeName>
                    </InputScope>
                </TextBox.InputScope>
            </TextBox>

Windows <wbr>phone <wbr>7 <wbr>之键盘的调用

            <TextBox Height="72" HorizontalAlignment="Left" Margin="64,312,0,0" Name="textBox2" Text="TelephoneNumber" VerticalAlignment="Top" Width="335">
                <TextBox.InputScope>
                    <InputScope>
                        <InputScopeName NameValue="TelephoneNumber"></InputScopeName>
                    </InputScope>
                </TextBox.InputScope>
            </TextBox>

Windows <wbr>phone <wbr>7 <wbr>之键盘的调用

            <TextBox Height="72" HorizontalAlignment="Left" Margin="64,390,0,0" Name="textBox3" Text="Url" VerticalAlignment="Top" Width="335">
                <TextBox.InputScope>
                    <InputScope>
                        <InputScopeName NameValue="Url"></InputScopeName>
                    </InputScope>
                </TextBox.InputScope>
            </TextBox>

Windows <wbr>phone <wbr>7 <wbr>之键盘的调用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值