允许用户在Windows 8应用程序中使用RichEditBox中的选项卡? [英] Allow user to use tab in RichEditBox in a Windows 8 App?
问题描述
现在,tab函数将焦点移动到下一个控件,我想要它只是在文本框中实际的tab。
Right now the tab function moves the focus to the next control, I want it so it just actually tab in the Text Box.
我注意到你不能Windows 8邮件应用程序也....
I noticed you cannot tab in the Windows 8 Mail app also....
还有一个RichTextBox的替代品?
Also is there a RichTextBox alternative?
推荐答案
目前(在RTM版本中)没有像 AcceptsTab -us / library / windows / apps / BR227548rel =nofollow> RichEditBox (它只有 AcceptsReturn )另请参阅此功能建议。
Currently (in the RTM release) there is no AcceptsTab
like setting for RichEditBox (it only has AcceptsReturn) see also this feature suggestion.
订阅 RichEditBox
的 KeyDown
事件,您可以在其中自行处理Tab键:
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;
}
}
}
这篇关于允许用户在Windows 8应用程序中使用RichEditBox中的选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!