Wpf UserControl使用 KeyBinding,失效问题
2021-03-19 17:23
标签:end ted detail 获取 route void public vat property
我的问题根源是UserControl未获取相应焦点,在UserControl后台添加如下 public AccountDetailView()
private void control_detail_Loaded(object sender, RoutedEventArgs e) Wpf UserControl使用 KeyBinding,失效问题 标签:end ted detail 获取 route void public vat property 原文地址:https://www.cnblogs.com/lonelyxmas/p/12329548.html
{
InitializeComponent();
this.IsEnabledChanged +=new DependencyPropertyChangedEventHandler(AccountDetailView_IsEnabledChanged);
}
{
tb_detail.Focusable = true;
Keyboard.Focus(this);
}
void AccountDetailView_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
{
if (!Convert.ToBoolean(e.NewValue)) return;
this.Focusable = true;
Keyboard.Focus(this);
}
上一篇:windows dll
下一篇:Window10中Anaconda安装第三方库出现HTTPError和SSLError( HTTP 000 CONNECTION FAILED for url)解决办法
文章标题:Wpf UserControl使用 KeyBinding,失效问题
文章链接:http://soscw.com/index.php/essay/66323.html