Alignment

Description

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

Applies to

Column, Computed Field, and Text controls

Syntax

Describe and Modify argument:

"controlname.Alignment { = ' alignmentvalue ' }"

DataWindowSyntaxFromSql:

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 DataWindowSyntaxFromSql, 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 the Properties window, Appearance category.

Examples

Example 1

[Visual Basic]
Dim AlignVal As String
WC1.SetProperty("EmpName.Alignment", "2")
AlignVal = dw1.Describe("EmpName.Alignment")
dw1.Modify("EmpName.Alignment='2'")

Example 2

[C#]
string AlignVal;
WC1.SetProperty("EmpName.Alignment", "2");
AlignVal = dw1.Describe("EmpName.Alignment");
dw1.Modify("EmpName.Alignment='2'");