views:

60

answers:

5

I Trying to switch Panel.TabStop property totrue but it does not affect anything.

How to enable TabStop in a Panel?

+1  A: 

A Panel does not accept keyboard focus because a Panel is not a control (per se), it's a container for other controls which probably accept keyboard focus.

If you're trying to create a custom control, derive from UserControl or Control.

Tergiver
@Timwi: "per se".. thanks for the correction =)
Tergiver
A: 

As I understand it, the TabStop property exists at the control level, but it really only affects what I would call interactive controls (there's probably an actual, correct term). Since panels can't directly receive the focus, they won't behave differently based on that flag.

Steven
+1  A: 

The TabStop property has no effect on the Panel control as it is a container object.

Checkout this MSDN Link for details.

Vinay B R
+1  A: 

As the others have said, the panel control will not accept focus. However, if you set TabStop to true and set its TabOrder, then the next control in the TabOrder should receive focus.

Joel Etherton
A: 

You have to put something that can accept focus onto it, like editbox. There you go :)

Daniel Mošmondor