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));
                }
            }
        }

 

posted on 2014-11-03 18:53  褚海达  阅读(575)  评论(0编辑  收藏  举报