WPF中TextBox获取焦点 ViewModel中设置
来源:http://www.tudoupe.com时间:2022-07-30
项目场景:
启动一个WPF页面需要一个文本框来集中注意力
问题描述
启动一个WPF页面需要在ViewModel中设置,允许一个文本框获得焦点,但使用textBox1.Focusable = true;无效。
最后改为Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, new Action(() =>textBox1.目标());实现预期效果后
相关新闻
- 2022-08-04 WPF的由来
- 2022-08-04 Win11勒索软件防护怎么打开?Win11安
- 2022-08-04 Windows系统jdk的配置
- 2022-08-04 Windows10 OneNote怎么重新登录?如何重
- 2022-08-04 超好用的 Windows 效率工具推荐
- 2022-08-04 Windows如何在CMD或PowerShell中配置代理
- 2022-08-04 powershell和cmd对比
- 2022-08-04 【QT】Windows下QT下载安装
- 2022-08-04 windows下 C++ 实现类属性的get和set方
- 2022-08-04 Win11快速助手在哪里?Win11打开快速
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
