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

2

5

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?
Ortrud answered 19/8, 2010 at 13:55 Comment(0)
M
4

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.

Madian answered 19/8, 2010 at 14:22 Comment(0)
P
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.

Philippians answered 19/8, 2010 at 14:2 Comment(1)
This mirrors my own thoughts for in respect of question 1. I guess the answer to question 2 might just be that the ability to set the ContentControl as a tabstop is a side effect of it inheriting from Control.Antinucleon

© 2022 - 2024 — McMap. All rights reserved.