The horizontal alignment of a control consists in defining the position of the text in the control in relation to the borders of the control. This allows you to center the content of a Static control in relation to the control borders.
Several alignments are available:
- alignment to left
- alignment to right
- centered
- justified
..HorizontalAlignment is used to find out and modify the horizontal alignment of a control.
The initial alignment of control is defined in the editor during the control description.
Versions 16 and later
New in version 16
Versions 18 and later
New in version 18
Versions 21 and later
New in version 21
// If the control is left-aligned, align it to right
IF STC_Static1..HorizontalAlignment = haLeft THEN
STC_Static1..HorizontalAlignment = haRight
END
Syntax
Finding out the horizontal alignment of a control Hide the details
<Current alignment>..HorizontalAlignment = <Control name>
<Current alignment>: Integer constant
Current horizontal alignment of control. The possible values are:
| |
haCenter | The text is centered. |
haRight | The text is aligned to right. |
haLeft | The text is aligned to left. |
haJustified | The text is justified. |
haNotDefined | Alignment defined by the CSS inheritance. This constant is available in WEBDEV only. |
<Control name>: Character string (with or without quotes)
Name of control to use.
Modifying the horizontal alignment of a control Hide the details
<Control name>..HorizontalAlignment = <New Alignment>
<Control name>: Character string (with or without quotes)
Name of control to use.
<New Alignment>: Integer constant
New horizontal alignment of the control. The possible values are:
| |
haCenter | The text is centered. |
haRight | The text is aligned to right. |
haLeft | The text is aligned to left. |
haJustified | The text is justified. |
haNotDefined | Alignment defined by the CSS inheritance. This constant is available in WEBDEV only. |