Alignment

Description

The alignment of the control’s text within its borders.

Applies to

Column, Computed Field, and Text controls

Syntax

PowerBuilder dot notation:

dw_control.Object.controlname.Alignment

Describe and Modify argument:

"controlname.Alignment { = ' alignmentvalue ' }"

SyntaxFromSql:

Text ( ... Alignment = alignmentvalue ... )

Parameter

Description

controlname

The name of the control for which you want to get or set the alignment.

alignmentvalue

(exp) A number specifying the type of alignment for the text of controlname. Alignmentvalue can be a quoted DataWindow expression.

Values are:

  • 0 – (Default) Left

  • 1 – Right

  • 2 – Center

  • 3 – Justified

When generating DataWindow syntax with SyntaxFromSql, the setting for Alignment applies to all text controls used as column labels.

Usage

When you select justified, the last line of text is not stretched to fill the line. Controls with only one line of text look left aligned.


In the painter

Select the control and set the value using:

Examples

Example 1

dw1.Object.emp_name_t.Alignment = 2

ls_data = dw1.Describe("emp_name.Alignment")

dw1.Modify("emp_name_t.Alignment='2'")