WPF 控件回车移动焦点

WPF 控件回车移动焦点
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 控件回车移动焦点

WPF 控件回车移动焦点

上一篇:Windows下python+allure的下载、安装、配置与使用


下一篇:微信公众号接口添加菜单时错误(errcode":40017 invalid button type)