首页 > 移动平台 > 详细

WPF 控件回车移动焦点

时间:2014-01-24 07:08:42      阅读:521      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
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);
            }
        }
bubuko.com,布布扣

WPF 控件回车移动焦点

原文:http://www.cnblogs.com/quietwalk/p/3531663.html

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