FocusNavigationDirection.Next未移至Next Control

时间:2012-04-29 17:29:30

标签: c# wpf datagrid focus

TraversalRequest request = new TraversalRequest(FocusNavigationDirection.Next);                    
MoveFocus(request);

我在DataGrid PreviewKeyDown事件中使用此代码,而Focus并未转移到Next Control,而是将其焦点转移到DataGrid之前的Two Control。

1 个答案:

答案 0 :(得分:2)

将此代码用于请求:

TraversalRequest request = new TraversalRequest(FocusNavigationDirection.Down);

请求使用关闭 希望有帮助