Why would I want IsTabStop set to true on a ContentControl?

雨燕双飞 提交于 2019-12-10 14:52:11

问题


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?

回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/3522477/why-would-i-want-istabstop-set-to-true-on-a-contentcontrol

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!