Montag, 17. Mai 2010

Wie ändere ich das Tastaturlayout?

In XAML würde es so aussehen:

<textbox Text="HelloWorld!">
<TextBox.InputScope>
<inputscope>
<inputscopename NameValue="<layout>" />
</InputScope>
</TextBox.InputScope>
</TextBox>

wobei <layout> folgende Werte annehmen kann:

Default - Standard QWERTY keyboard
Text - Standard text with features such as autocorrect and text suggestion
Url - User types a URL
EmailSmtpAddress - User types an e-mail address
EmailNameOrAddress - User types an e-mail name or address
Maps - User types a location to search for on a map
TelephoneNumber - User types a telephone number
Search - User types a search query
NameOrPhoneNumber - User types in the SMS To field
Chat - Text input that uses intelligent features such as abbreviations

... und wer lieber programmiert das Ganze in C#-Code:

InputScope inputScope = new InputScope();
InputScopeName inputScopeName = new InputScopeName();
inputScopeName.NameValue= InputScopeNameValue.Url;
inputScope.Names.Add(inputScopeName);
textbox.InputScope = inputScope;

Keine Kommentare:

Kommentar veröffentlichen