《TextBox》——— InputScope枚举列表
InputScope 枚举如下:
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
使用c#代码在构造函数或者在页面加载的时候添加如下代码实现
InputScope inputScope = new InputScope(); InputScopeName inputScopeName = new InputScopeName(); inputScopeName.NameValue = InputScopeNameValue.Url; inputScope.Names.Add(inputScopeName); textBox.InputScope = inputScope; textBox.Focus();
注意,在代码中我使用了textBox.Focus()函数,为了在应用程序进入的时候光标自动放在textBox输入框中,方便输入。
真的是好多啊 ⊙﹏⊙b汗