IsTabStop =“假".对我的WPF应用没有影响 [英] IsTabStop="False" has no effect on my WPF app

查看:76
本文介绍了IsTabStop =“假".对我的WPF应用没有影响的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很难应付一些琐碎的事情.我只想从UserControl的选项卡顺序中删除一些按钮.我尝试将 IsTabStop ="False" KeyboardNavigation.IsTabStop ="False" 属性添加到其xaml声明中,以及设置 myButton.IsTabStop = false; 在UserControl的Loaded事件处理程序中.这些添加都没有任何效果,我仍然可以选择执行此操作的控件.

I'm having a really hard time with something that should be trivial. I just want to remove a few buttons from the tab order on a UserControl. I've tried adding IsTabStop="False" and KeyboardNavigation.IsTabStop="False" attributes to their xaml declarations, as well as setting myButton.IsTabStop = false; in the Loaded event handler for the UserControl. None of these additions had any effect, I could still tab to the controls I did this for.

在xaml中设置TabIndex可以正常工作.如果这可能会有所不同,则在WPFElementHost中显示UserControl.我的另一种想法是,可能需要为所有其他控件指定TabIndex,但是我还没有在任何地方阅读过该标签,因此,我尽可能不明确声明.有没有人猜测可能出了什么问题?

Setting the TabIndex in the xaml works fine. The UserControl is being displayed in a WPFElementHost if that might make a difference. The other thought I had was that I might need to specify the TabIndex for all the other controls, but I haven't read that anywhere and I'd prefer to not state that explicitly if possible. Does anyone have a guess as to what might be going wrong?

推荐答案

尝试在父控件中设置 KeyboardNavigation.TabNavigation ="None" .

这篇关于IsTabStop =“假".对我的WPF应用没有影响的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆