DxCK
DxCK

Reputation: 4552

Panel.TabStop = true has no effect

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

How to enable TabStop in a Panel?

Upvotes: 5

Views: 2160

Answers (6)

Jack Ukleja
Jack Ukleja

Reputation: 13501

Try setting Focusable=true for the Panel you are using.

Upvotes: 0

Daniel Mošmondor
Daniel Mošmondor

Reputation: 19956

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

Upvotes: 0

Steven
Steven

Reputation: 1280

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.

Upvotes: 0

Tergiver
Tergiver

Reputation: 14507

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.

Upvotes: 1

Joel Etherton
Joel Etherton

Reputation: 37523

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.

Upvotes: 1

Vinay B R
Vinay B R

Reputation: 8421

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

Checkout this MSDN Link for details.

Upvotes: 1

Related Questions