ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / Properties associated with windows, pages and controls
  • Horizontal alignment and text not entirely displayed in the control
  • Vertical alignment
  • Limitation
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
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
    Text aligned to left
  • alignment to right
    Text aligned to right
  • centered
    Text centered
  • justified
The HorizontalAlignment property is used to get and change the horizontal alignment of a control.
The initial alignment of control is defined in the editor during the control description.
Example
// 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:
haCenterThe text is centered.
haJustifiedThe text is justified.
haLeftThe text is aligned to the left.
haNotDefinedAlignment defined by the CSS inheritance.
This constant is available in WEBDEV only.
haRightThe 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:
haCenterThe text is centered.
haJustifiedThe text is justified.
haLeftThe text is aligned to the left.
haNotDefinedAlignment defined by the CSS inheritance.
This constant is available in WEBDEV only.
haRightThe text is aligned to the right.
Remarks
WINDEVReports and QueriesUniversal Windows 10 AppAndroidiPhone/iPadMac CatalystJavaUser code (UMC)

Horizontal alignment and text not entirely displayed in the control

The following information is displayed if the text cannot be entirely displayed in the control:
  • In the report editor, the left part of the text is displayed.
  • In the window editor:
    • in a static control, the right part of text is displayed.
    • in an edit control, the left part of text is displayed.

Vertical alignment

To define the vertical alignment of the control, use the VerticalAlignment property.

Limitation

WINDEV In a window, the HorizontalAlignment property is used to get and change the horizontal alignment for the following types of controls:
  • Static control
  • Edit control
  • Combo Box (editable or not)
  • Check Box / Radio Button
  • List Box
  • ListView
  • Image
  • Column in a table and column in a TreeView Table
  • Cell in a status bar
  • Bar code
  • Chart
  • Progress Bar. The property is used to find out and modify the horizontal alignment for the percentage of progress displayed in the progress bar.
  • Rating control
  • Organization Chart
WEBDEV - Server code In a page, the HorizontalAlignment property is used to get and change the horizontal alignment for the following types of controls:
  • Static, HTML static
  • Edit control
  • Button
  • Check Box / Radio Button
  • Table, table column
  • Treeview table, column in TreeView Table
  • Table cell (read-only)
  • Formatted control
  • List box, Combo box
  • Looper
  • HTML control
  • Link
  • Pager
  • Breadcrumb
  • TreeView
PHP In a PHP page, the HorizontalAlignment property is used to get and change the horizontal alignment for the following types of controls:
  • Static, HTML static
  • Edit control
  • Button
  • Check Box / Radio Button
  • Table, table column
  • Treeview table, column in TreeView Table
  • Formatted control
  • List box, Combo box
  • Looper
  • HTML control
  • Link
  • Pager
  • TreeView
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppAndroidiPhone/iPad In a report, the HorizontalAlignment property is used to get and change the horizontal alignment for the following types of controls:
  • Static control.
  • Calculated control.
  • Preset control.
  • Chart control.
  • Groups of controls. This property will only apply to controls that support horizontal alignment.
Java The HorizontalAlignment property applies only to the following controls:
  • Static control.
  • Edit control.
  • Image.
  • Check Box.
  • Radio Button.
  • List Box.
  • Combo Box.
  • Table column (text, combo box or check box).
AndroidiPhone/iPadMac Catalyst The HorizontalAlignment property can be used on table columns.
IOS Widget The HorizontalAlignment property can be used on Static controls.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help