为什么我希望在 ContentControl 上将 IsTabStop 设置为 true?

发布于 2024-09-15 02:13:32 字数 266 浏览 3 评论 0原文

鉴于以下情况:

  • 在 ContentControl 上将 IsTabStop 设置为 false 不会阻止其内容充当制表位,
  • 将 IsTabStop 设置为 true 将导致不可见的制表位,这不会执行任何操作,在您的应用程序中

我有以下两个问题:

  1. 为什么 ContentControl 的 IsTabStop 默认为 true
  2. 为什么我希望 ControlControl 充当制表位?

Given the following:

  • setting IsTabStop to false on a ContentControl will not prevent its content from acting as a tab-stop
  • setting IsTabStop to true will result in an invisible tab-stop, which does nothing, in your application

I have the following two questions:

  1. Why is IsTabStop true by default for the ContentControl
  2. Why would I ever want the ControlControl to act as a tab-stop?

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

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

发布评论

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

评论(2

滥情稳全场 2024-09-22 02:13:32

Douglas 是正确的,ContentControl 只是从 Control 继承了 IsTabStop 的默认值。此外,没有充分的理由假设 true 的值对于 ContentControl 的有效性不如对于 Control 的有效性。

例如,您可能有一个控件希望其内容是图形内容,例如一组 Shape 元素或 Image。但是,当用户按下特定键时,您的控件可能会对内容执行某些操作。

Douglas is correct ContentControl simply inherits the default value of IsTabStop from Control. Also there is no good reason to assume that the value of true is less valid for a ContentControl than it is for Control.

For example, you might have a control that expects its content be something graphical such a set of Shape elements or an Image. However your control may perform certain operations on the content when the user presses specific keys.

梨涡 2024-09-22 02:13:32

ContentControl 从 Control 获取 IsTabStop 属性,因此所有控件都可以是制表位,包括 ContentControl。

我不确定为什么 ContentControl 默认情况下它是 true,可能只是因为它在 Control 中默认为 true。

The ContentControl gets it's IsTabStop property from Control, so all controls can be tab stops, including ContentControls.

I'm not sure why it is true by default for a ContentControl though, probably just because it defaults to true in Control.

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