在一些控件(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>
<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>
<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>