WinForms TabOrder tool: Broken or just confusing?

bwerks picture bwerks · Jun 17, 2010 · Viewed 7.9k times · Source

I have a form with a bunch of panels, and some panels inside groupboxes. When using the TabOrder tool in Vs2005, the controls outside of containers are given integers (0), the controls inside panels are given decimals (72.0), and the controls within panels within groupboxes are given three-part values (73.73.0). Unfortunately the resulting tab order has nothing to do with the order I clicked my controls.

Does this tool simply not support nested containers? Am I doing something wrong? Perhaps holding Shift- or Ctrl- when I click (I've tried these with no success)?

Am I going to be forced to manually type in three-part tab orders for all my controls? That would be a bummer.

Answer

Adam Robinson picture Adam Robinson · Jun 17, 2010

The tab order tool is not designed for you to enter values manually; it is designed for you to click on controls in the order that you'd like them to progress as the user tabs.

The numbers are not decimals; they represent the tab order of the control within its parent container. For example, if you have a Form with a Panel named panel1 and a Button inside of it named button1, then button1 would display a number like:

X.Y
  • X is the tab order of panel1
  • Y is the tab order of button1 within panel1.

I will acknowledge that the designer isn't as intuitive (or transparent) as it probably should be, but it does work.