WPF中类似使用tab键功能,可以向上向下定位

private void tbYyrs_KeyUp(object sender, KeyEventArgs e)
        {
            UIElement element = Keyboard.FocusedElement as UIElement;
            if (e.Key == Key.Down || e.Key == Key.Enter)
            {
                if (element != null)
                {
                    element.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
                }
            }
            if (e.Key == Key.Up)
            {
                if (element != null)
                {
                    element.MoveFocus(new TraversalRequest(FocusNavigationDirection.Previous));
                }
            }
        }

 

WPF中类似使用tab键功能,可以向上向下定位

上一篇:iframe,window,滚动条的一些问题


下一篇:解决Windows server 2012 R2 系统使用IIS8浏览Asp程序出现"An error occurred on the server when processing the URL"错误