C# 使用 Tab 键实现下一个输入框的焦点跳转
var text = new TextBox() { Margin = new Thickness(0, 5, 0, 5), FontSize = 17, Foreground = Brushes.Blue, VerticalAlignment = VerticalAlignment.Center, Name = strName3[i] };
text.KeyDown += (sender, e) => { if (e.Key == Key.Tab) { e.Handled = true; var request = new TraversalRequest(FocusNavigationDirection.Next); (sender as UIElement).MoveFocus(request); } };
原文地址: https://www.cveoy.top/t/topic/kow6 著作权归作者所有。请勿转载和采集!