为什么我希望在 ContentControl 上将 IsTabStop 设置为 true?
鉴于以下情况:
- 在 ContentControl 上将 IsTabStop 设置为 false 不会阻止其内容充当制表位,
- 将 IsTabStop 设置为 true 将导致不可见的制表位,这不会执行任何操作,在您的应用程序中
我有以下两个问题:
- 为什么 ContentControl 的 IsTabStop 默认为 true
- 为什么我希望 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:
- Why is IsTabStop true by default for the ContentControl
- Why would I ever want the ControlControl to act as a tab-stop?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Douglas 是正确的,
ContentControl
只是从Control
继承了IsTabStop
的默认值。此外,没有充分的理由假设true
的值对于ContentControl
的有效性不如对于Control
的有效性。例如,您可能有一个控件希望其内容是图形内容,例如一组
Shape
元素或Image
。但是,当用户按下特定键时,您的控件可能会对内容执行某些操作。Douglas is correct
ContentControl
simply inherits the default value ofIsTabStop
fromControl
. Also there is no good reason to assume that the value oftrue
is less valid for aContentControl
than it is forControl
.For example, you might have a control that expects its content be something graphical such a set of
Shape
elements or anImage
. However your control may perform certain operations on the content when the user presses specific keys.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.