Aligning items relative to other items

Items with relative positioning are positioned in relation to other items on the form. Their itemlocation information is dependent upon an anchor item. If you move the anchor item, all of its dependent items move to maintain their positions relative to the anchor item.

You can place items on a form to align with other reference items on the form. As a results of setting relative alignment, you can later move the reference item and all other items set relative to it will also move with it. Relative positioning can affect more than the location of items. Relative positioning can also affect the alignment and size of items. Any adjustments to the location or size of a reference item could potentially affect numerous other items. This is a quick way to move, resize or apply font attributes to a group of items so that they line up with other items exactly when designing the form layout.

For example, you have a label at position 10,10 on your form. You create a field, and used relative positioning to place it after the label. The field would be placed immediately next to the label. If you were to move the label to a position of 20, 20, the field would move with the label in order to remain after it. The field would have no absolute position of its own, but instead would base its position on where the label had been placed.

Examples of when you must use relative positioning:
  • If you are transferring form information from a database table with an indefinite number of rows.
  • If some forms have dynamically created sections, such as a purchase order form that allows users to add multiple rows.
  • When you are using relative positioning, the bounding box determines how items are positioned. For detailed information about bounding boxes, see Displaying bounding boxes.
  • When you use relative positioning, you are limited by the build order. Understand the build order of your form before setting the alignment of items.

    Items that are relatively positioned define a relationship and a reference item. The reference item must precede the item being aligned. If an item tries to reference an item that follows it in the build order then the item location will be ignored. For detailed information about build order, see Changing the build order of items.

To align items using relative positioning:
  1. Select the item(s) you want to move.
  2. Hold down the Ctrl key and click the item on the form you want to use as the reference item.
  3. Right-click and click Relative Align.
  4. Choose the modifier that describes the way you want to align the items.
Now move the reference item and notice the other selected item set relative to it also move. For detailed information about alignment types, see Alignment types.