所有 WPF 控件都可聚焦吗?

发布于 2024-09-15 17:36:56 字数 112 浏览 10 评论 0原文

wpf 控件是否存在不可聚焦的默认异常?

我的控件需要全部可聚焦,但我不想每次创建控件时都进行设置

make focusable="true"

Are there any default exceptions where wpf controls are not focusable?

My controls need to be all focusable, but I do not want to set everytime I create a control

make focusable="true"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

大海や 2024-09-22 17:36:56

一般来说,WPF 控件在是否可聚焦方面按预期工作。您可以与之交互的东西,例如按钮、列表/项目控件、文本框都是可聚焦的。像 TextBlock、Image 这样的非交互式控件是不可聚焦的。因此,通常情况下,您不必处理设置 Focusable 属性的值。我不确定这是否是您正在寻找的内容,但我希望这会有所帮助。

In general, WPF controls work as expected with regards to being focusable or not. Things you can interact with such as button, list/items controls, textbox are all focusable. Non-interactive controls like TextBlock, Image are non-focusable. So normally, you don't have to deal with setting the value of the Focusable property. I'm not sure if this is what you're looking for but I hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文