问题
Right now the tab function moves the focus to the next control, I want it so it just actually tab in the Text Box.
I noticed you cannot tab in the Windows 8 Mail app also....
Also is there a RichTextBox alternative?
回答1:
Currently (in the RTM release) there is no AcceptsTab
like setting for RichEditBox (it only has AcceptsReturn) see also this feature suggestion.
However you can subscribe on the KeyDown
event of your RichEditBox
where you can handle the tab key yourself:
private void RichEditBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == VirtualKey.Tab)
{
RichEditBox richEditBox = sender as RichEditBox;
if (richEditBox != null)
{
richEditBox.Document.Selection.TypeText("\t");
e.Handled = true;
}
}
}
来源:https://stackoverflow.com/questions/12654213/allow-user-to-use-tab-in-richeditbox-in-a-windows-8-app