问题描述
给定以下内容:- 在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 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.
这篇关于为什么我要在ContentControl上将IsTabStop设置为true?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!