private void MainContentGrid_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
    
    var uie = e.OriginalSource as UIElement;
    //string n = ((FrameworkElement)e.OriginalSource).Name; //컨트롤 이름

    if (e.Key == Key.Enter)
    {
        e.Handled = true; 
        uie.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
        
    }
}

위와 같이 하면MainContentGrid 안에 포함된 (TextBox /ComboBox 등등) 컨트롤이 Tab 순서에 맞게 이동됩니다.

+ Recent posts