2

I need the auto-correct functionality of the Text InputScope, but I also want the white submit button provided with the Search InputScope (otherwise it isn't intuitive to users how to proceed from the box).

Is there any way to write my own InputScopes so that I can control these features independently? Or is there a way to apply more than one scope for combined functionality?

Here's the code:

This has the button but no auto-correct:

<TextBox x:Name="InputBox" InputScope="Search" AcceptsReturn="False" KeyUp="InputBox_KeyUp"/>

And this had auto-correct but no button:

<TextBox x:Name="InputBox" InputScope="Text" AcceptsReturn="False" KeyUp="InputBox_KeyUp"/>

For the record, I've read this post and I really hope it doesn't come to that.

4

2 回答 2

2

InputScope="Maps" will show the keyboard used by the Maps app, which includes both the dictionary and white submit button. The only differences that I can see from the "Text" keyboard is that it doesn't start out with a capital letter and doesn't have a key for emoticons.

enter image description here

于 2011-07-10T20:39:58.393 回答
1

In your code-behind, in your Page_Loaded event (for example), try adding something like this:

var isSearch = new InputScopeName { NameValue = InputScopeNameValue.Search };
var isText = new InputScopeName { NameValue = InputScopeNameValue.Text };

myTextBox.InputScope = new InputScope();
myTextBox.InputScope.Names.Add(isSearch);
myTextBox.InputScope.Names.Add(isText);

This should hopefully give you the dictionary from the Text input scope whilst also having a white submit button from the Search input scope.

于 2011-07-08T20:07:27.077 回答