首页 > Windows开发 > 详细

WPF中Enter 焦点转移方法

时间:2016-08-20 01:26:51      阅读:265      评论:0      收藏:0      [点我收藏+]

1.Set the TabIndex="16"
2.
private void detailGrid_Keydown(object sender, KeyEventArgs e)
{
try
{
if (e.Key == Key.Enter)
{
TraversalRequest request = new TraversalRequest(FocusNavigationDirection.Next);

UIElement focusElement = Keyboard.FocusedElement as UIElement;
if (focusElement != null)
{
focusElement.MoveFocus(request);
}
e.Handled = true;
}
}
catch (Exception e1)
{
ExceptionDialog.Show(e1);
}
}

WPF中Enter 焦点转移方法

原文:http://www.cnblogs.com/gylhaut/p/5789415.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!