为什么我要在ContentControl上将IsTabStop设置为true? [英] Why would I want IsTabStop set to true on a ContentControl?
问题描述
- 在ContentControl上将IsTabStop设置为false将不会阻止其内容充当制表位。 li>
- 将IsTabStop设置为true会导致在您的应用程序中无法看到的制表符停止位置
我有以下两个问题:
- 为什么IsTabStop默认为ContentControl为真
- 为什么我要把ControlControl作为一个制表符?
解决方案是正确
ContentControl 从
Control
只是继承了IsTabStop
的默认值>。也没有理由认为true
对于ContentControl
的有效性比对Control
。
例如,你可能有一个控件,它的内容应该是图形的,例如
Shape
元素或者图片
。但是,当用户按下特定的按键时,您的控件可能会对内容执行某些操作。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?
解决方案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上将IsTabStop设置为true?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!