键盘种类:
重要说明:
Windows Phone 应用程序中不支持下列输入范围:ApplicationEnd、EnumString、PhraseList、Private、RegularExpression、Srgs、Xml。
使用:
在xaml文件中添加TextBox控件 设置如下代码
<TextBox x:Name="SearchInofTextBox" TextWrapping="Wrap" InputScope="Search" KeyUp="SearchInofTextBox_KeyUp"/>
TextWrapping:设置是否自动换行
InputScope:设置使用的键盘类型
KeyUp:设置释放键盘按键发生的事件
C#代码:
private void SearchInofTextBox_KeyUp(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter) //判断按键,执行代码
{
this.Focus(); //隐藏虚拟键盘,回到程序界面
}
}