Rotating controls in a DataWindow object

Controls that display text, such as text controls, columns, and computed fields, can be rotated from the original baseline of the text. The Escapement option on the Font properties page for the control lets you specify the amount of rotation, also known as escapement.

Several other properties of a rotated control affect its final placement when the DataWindow object runs. The location of the control in Design view, the amount of rotation specified for it, and the location of the text within the control (for example centered text or left-aligned text) all contribute to what you see in the DataWindow object Preview view.

The following procedure includes design practices that help ensure that you get the final results you want. As you become more experienced you can drop or alter some of the steps. The procedure recommends setting a visible border on the control so you can see where the control is located in the Preview view and making the control movable in the Preview view, which is often helpful.

StepsTo rotate a control in a DataWindow object:

  1. Select the control in the Design view.

  2. On the General properties page, change the control’s border to Box.

    On the Position properties page make the control movable.

  3. In Design view, enlarge the area in which the control is placed.

    For example, in a grid DataWindow object, make the band deeper and move the control down into the center of the band.

  4. From the Font properties page, display the Modify Expression dialog box.

    You click the button next to the Escapement property to display the dialog box.

  5. Specify the amount of rotation you want as an integer in tenths of a degree. (For example, 450 means 45 degrees of rotation; 0 means horizontal or no rotation.)

    The origin of rotation is the center of the top border of the box containing the text. It is often helpful to use left-aligned text (General properties page>Alignment>Left) because it makes it easier to position the control correctly. The example in Figure 19-2 shows text centered within the control.

    Figure 19-2: Positioning a text control to make space for text rotation

    The sample shows a Data Window named contract grid. The Escapement fied is visible on the Font tab or the  Properties view. In the Design view, the Header area has been expanded and the Last Name control has been moved down to the center of the enlarged band.
  6. To display the current rotation in Preview, close the Preview view and reopen it (View>Preview on the menu bar).

    Figure 19-3: Displaying rotated text in the Preview view

    The sample shows a Data Window named contract grid. In the Preview view,  the Last Name column header has been rotated to the left and the text is at a 45 degree angle.
  7. Drag and drop the control in the Preview view or Design view until it is where you want it.

  8. In Design view, select the control that is being rotated, remove the temporary border, and deselect the Moveable check box.

NoteIf you are using a conditional expression for rotation If you are specifying different rotations depending on particular conditions, you might need to add conditions to the control’s x and y properties to conditionally move the control to match the various amounts of rotation. An alternative to moving the control around is to have multiple controls positioned exactly as you want them, taking into account the different amounts of rotation. Then you can add a condition to the visible property of each control to ensure that the correctly rotated control displays.