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
// 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 used>
<Current alignment>: Integer constant
Current horizontal alignment of control. The possible values are:
| |
haCenter | The text is centered. |
haJustified | The text is justified. |
haLeft | The text is aligned to the left. |
haNotDefined | Alignment defined by the CSS inheritance. This constant is available in WEBDEV only. |
haRight | The text is aligned to the right. |
<Control used>: Control name
Name of the control to be used.
Modifying the horizontal alignment of a control Hide the details
<Control used>.HorizontalAlignment = <New alignment>
<Control used>: Control name
Name of the control to be used.
<New alignment>: Integer constant
New horizontal alignment of the control. The possible values are:
| |
haCenter | The text is centered. |
haJustified | The text is justified. |
haLeft | The text is aligned to the left. |
haNotDefined | Alignment defined by the CSS inheritance. This constant is available in WEBDEV only. |
haRight | The text is aligned to the right. |