For most applications, the tab order is determined by explicitly defining a tab index for each control as the application is created. This is not sufficient, however, for those applications that allow you to move fields around with the Form Designer. If the tab order were explicitly defined in those applications, then moving fields would cause the tab order to jump around the screen since each control would retain its original tab index. Deltek could have allowed users to specify the tab indexes from within the Form Designer; however, because controls can be hidden for specific roles, the tab order specified for one role might not work as well for another. Instead, Deltek developed an algorithm to calculate an appropriate tab order based on the layout of the controls at run-time. Only visible controls are considered, so each role gets a tab order that makes sense.
The algorithm is based on the idea that the fields on the screen can be divided into groups, each of which has a fairly simple tab order. After the groups are established, the final tab order is determined by placing the groups in an appropriate order.
The way in which fields are grouped together is based upon the layout standards Deltek use when designing screens. To be considered a group, fields must be left-aligned (within two pixels), and their top positions must be no more than 29 pixels apart (the Deltek standard is 27 pixels, but the algorithm allows for an additional two pixels as a leeway factor).
For most fields, labels are not considered when grouping fields; however, check box labels are usually part of the control itself; therefore, if the caption were on the left of the check box (which sometimes occurs), then the grouping would be based on the left position of the caption, not the check box. Also, even though they do not appear as such, check boxes are the same height as other input controls with the actual check box centered vertically within the control.
When the tab order gets to the first field in a group box, it continues through all of the fields in that group box before going elsewhere. This issue is addressed by treating the group box as a mini-screen. In other words, the entire algorithm is run for just the group box, and then that portion of the tab order is merged into the rest of the screen as if the group box were a single group located at the top left of the group box.
The algorithm attempts to merge single-field groups into other groups so that the tab order flows smoothly. If a single-field group has the same top coordinate as any other field, it is inserted into the other field’s group. If it shares the same top coordinate with multiple fields, it is placed after the nearest field to its left if one exists. Otherwise, it is placed before the nearest field to its right.
After the field groups have been defined, the groups are ordered based on the top-left corner of the first field in each group. The groups are ordered from top to bottom, and if the top values of any groups match, then they are ordered from left to right.
After determining the group order, any group boxes are merged into the primary group order by treating the entire group box as a single group.
For this final step, the algorithm goes through each group in order, and within each group, each control in order, and adjusts the tab indexes accordingly. When a group box is processed, each internal group is processed in order before proceeding to the next primary group.
Learn about the Form Designer toolbar
Customize form elements using the Form Designer
Work with locked, hidden, or required fields