TabStop is not working
Asked Answered
M

7

7

We have a form and textboxes in it. All of control's tabindex are set correctly and TabStop = true. When some textbox is focused and when I press tab, focus is not set on next textbox.

Note : Controls are in the panel and its TabStop = true

Mintz answered 6/6, 2011 at 15:58 Comment(0)
D
8

Set TabStop for the panel to false

Make sure that the tab indexes are like the following:

enter image description here

Remember that you have a nice tool to set the Tab indexes in Visual Studio:enter image description here

Dewclaw answered 6/6, 2011 at 16:13 Comment(4)
@ Ümit: Have you tried in a new application? is there a KeyUpChanged event or ant key event ?Dewclaw
No such Tab Order thing in my VS2015 installation.Kopple
And when I went back there it's showing up now. Doesn't do the job, though, I still get them in creation order no matter what.Kopple
Has someone a solution I have the same Problem in Powershell, from the first TextBox to the second TextBox TabIndex is not working correctly, the form is loading and I have to click two times tab to working, what is the right solution here?Cooper
E
2

Old post and nothing here helped me. Tried everything including to force .Select() e .Focus() on the controls. For some reason taborder was behaving all in a funny order, even disabling/setting visible = false on one control other orders was wrong as if the tab index was working in reverse.

Only thing help was de Document Outline, you can open that box with Ctrl + W, U or by the menu on VS.

VIEW -> Other Windows -> Document Outline

It ill show your controls in a tree fashion. Just drag the controls to the correct order, it ill affect the tab order.

Word of warning: I struggled a bit with it because dragging (in the Document Outline box) some controls inside a panel caused them to move to the top upper corner of the panel (in the Designer). Just dragged them back to the position in the Designer.

For some reason the order the controls are show in the Outline Document box affects tab behaviour in nasty ways.

Emelyemelyne answered 3/11, 2015 at 16:22 Comment(0)
K
2

My solution: Containers must have the tab numbers set correctly even though they are not stops. Finally working!

Kopple answered 17/6, 2017 at 19:37 Comment(0)
R
0

Have you set the tab order correctly? Select the form in designer view and select View > Tab Order to set the correct order.

Rabat answered 6/6, 2011 at 16:3 Comment(0)
P
0

Set TabStop for individual controls. Remove it from panel.

Planimetry answered 6/6, 2011 at 16:4 Comment(1)
I tried all combinations, panel false, controls true | panel true, controls true | panel false, controls false | panel true, controls falseMintz
R
0

Perhaps the TextBox that you can't tab from is a multiline TextBox with AcceptsTab set to true? This would cause the TextBox to consume the tab key itself.

Rubeola answered 6/6, 2011 at 16:12 Comment(1)
AcceptsTab property is setted to false.Mintz
L
0

I know this is an old post but I've just had a similar issue and thought I'd share my solution.

Check that you have set the TabIndex before adding the control to it's parents Control collection.

I noticed for the controls that were being skipped I was adding them to the parent before setting their TabIndex. Once I set the TabIndex and then added them to the collection they behaved as expected.

One thing to note is that Visual Studio showed the tab order I wanted but at run time it did not behave that way.

Lederman answered 20/6, 2015 at 15:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.