为什么我要在ContentControl上将IsTabStop设置为true? [英] Why would I want IsTabStop set to true on a ContentControl?

查看:144
本文介绍了为什么我要在ContentControl上将IsTabStop设置为true?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定以下内容:


  • 在ContentControl上将IsTabStop设置为false将不会阻止其内容充当制表位。

    li>
  • 将IsTabStop设置为true会导致在您的应用程序中无法看到的制表符停止位置


    我有以下两个问题:


    1. 为什么IsTabStop默认为ContentControl为真

    2. 为什么我要把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:

    1. Why is IsTabStop true by default for the ContentControl
    2. 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆