Avatar of HLRosenberger
HLRosenberger
Flag for United States of America asked on

Tab order

I have a form with a lot of controls, including panels.  I can't get my tab order correct, even though I'm setting all the TabIndex values correctly, as far as I can tell.   Also, it seems like controls within a panel can have their own order?  I tried using the View/Tab Order menu item, but that gives me a bunch of numbers that make no sense to me.  See image.

How get I set the tab order correctly?  It is maybe better/easier to do at run time?

 View - Tab Order
Visual Basic.NET.NET ProgrammingVisual C++.NET

Avatar of undefined
Last Comment
HLRosenberger

8/22/2022 - Mon
Éric Moreau

that's lot of controls!

you normally click the first control, the the second one, then the 3rd, .... that will set the tab order but seeing the number you have, it will be a pane!

I use the 3rd party tool named mz-tools (http://mztools.com/). it has a nice/better tab order utility
HLRosenberger

ASKER
A pain.  I agree!  What are those numbers?  63.1, 63.1.1.193, etc?
HLRosenberger

ASKER
I installed it.  Just briefly - how do I use once installed?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
HLRosenberger

ASKER
I see this:

tabs
sarabande

you may open the .rc file with a text editor (choose open with... in visual studio).

then search your form and bring all the controls you see into the right order. the tab order only is determined by the order the controls are placed in the .rc file.

Sara
Éric Moreau

there is a button named Automatic. if you click on it, it will do its best to reorder your controls.
and you can always use the 2 arrows to modify the ordering
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
HLRosenberger

ASKER
but I don't understand the numbers.  What so large?  Why decimal places?  I was expected to just see the tabindex property values.
Éric Moreau

this is the winforms designer!

the . represents level. i see that you have a panel containing tabs containing group containing panels ...
HLRosenberger

ASKER
correct.  I don't see how to change the order using MZTools?  All it allows me to do is navigate the list???
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Éric Moreau

as I wrote before, the "automatic" button at the top will try to reorder all your controls based on the container object and their location. Once you have done this, if any are misplaced, you can use the 2 arrows (on the left of the automatic button) to fine-tune the ordering
HLRosenberger

ASKER
Yes, I did automatic, and that did a good job. However, if I look at the TabIndex property, they are all set to 1.  How does this thing work?   Also, they are two textboxes  I want to make last in the tab order.   I cant move it by itself I suppose, because it's on a panel.  I can move it's parent panel, but only so far.  Seems like I can only move it to the "end" of it's parent panel.  Does that make sense?  If I want to move it to the very end of the tab order for the form, I need to move it off it's panel, I suppose.
Éric Moreau

>>if I look at the TabIndex property, they are all set to 1.  

If you run the application and tab through the control, are they in the correct order?

>>Also, they are two textboxes  I want to make last in the tab order.  

Click on one of the textbox and use the arrow to move it down. Repeat for the second control.

>>I cant move it by itself I suppose, because it's on a panel.  

You won't be able to move them outside the scope of the panel for sure.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
HLRosenberger

ASKER
yes, the Auto button did a good job.   At runtime, they are in the correct order.  But I don't understand how/why?   How can that be when all the TabIndex properties are set to 1?

And correct.  I can't more outside the panel.   But I thought the tab order on a windows form could be set independently of the parent container?
ASKER CERTIFIED SOLUTION
Éric Moreau

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
HLRosenberger

ASKER
well, it's works just fine.  I just don't get how, when all the TabIndex properties are set to 1.

Thanks!
HLRosenberger

ASKER
thanks.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23