当我尝试从使用手写的画布在文本框中添加文本时,光标移至文本框并显示键盘,并尝试添加一些代码,如使文本框isReadonly或尝试隐藏键盘并不起作用。 我希望每次都从列表框中选择一个项目,将项目添加到文本框中而不显示键盘。一个ListBox隐藏键盘Windows Phone 8.1
private void RecognizedListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (RecognizedListBox.SelectedItem == null)
return;
//gte the selected item from listbox
string inputTextWritePad = RecognizedListBox.SelectedItem.ToString();
//add the item to RichEditBox
MyTextNote.Text += inputTextWritePad + " ";
//clear the canvas return the listbox to vide
ClearAllClick(sender, e);
}
如果我添加isReadonly的文本框上RecognizedListBox_SelectionChanged的动作,将永久禁止对其进行编辑,并使用键盘我不能添加任何文字。我不知道我会在哪里放置我的代码,或者确认何时需要键盘才能使用它。 我看看我是否需要隐藏键盘,我必须对键盘按键或什么事件这样
private void TextBox_KeyUp(object sender, KeyRoutedEventArgs e)
{
if(e.Key==Windows.System.VirtualKey.Enter)
{
Windows.UI.ViewManagement.InputPane.GetForCurrentView().TryHide();
}
}
,但没有搞清楚!
更新1: 我添加此代码
private void MyTextNote_GotFocus(object sender, RoutedEventArgs e)
{
InputPane.GetForCurrentView().TryHide();
}
,并帮我不能显示的键盘,但我需要表现出来,当我点击文本框,我尝试丝毫挖掘,但没有帮助。
如果你是好与禁用您文本框,为什么不使用一个标签呢? – yoogeeks
我不想禁用我的文本框,我使用手写识别来添加一些单词,如果有一些错误的单词,我想尝试修改它,所以我需要将文本框 – Amin
设置为关闭TextBox。 – yoogeeks