WPF 文本框自动获取焦点
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
// 版本1,通过Background dispatcher
this.Dispatcher.BeginInvoke(DispatcherPriority.Background,
(Action)(() => { Keyboard.Focus(TextBox2); }));
/
原创
2020-08-14 10:19:23 ·
1335 阅读 ·
0 评论