ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage properties / Properties associated with windows, pages and controls
  • Horizontal alignment and text that overflows the control
  • Vertical alignment
  • Limitation
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Horizontal alignment determines how the text is positioned relative to the borders of the control. This allows you to center the content of a Static Text control in relation to the control borders.
There are different alignment options:
  • alignment to the left
    Text aligned left
  • right-hand alignment
    Text aligned right
  • centered
    Centered text
  • justify
The HorizontalAlignment property gets and changes the horizontal alignment of a control.
The initial alignment is defined in the editor, in the control description.
Example
// Si le champ est cadré à gauche, on le cadre à droite
IF LIB_libellé1.CadrageHorizontal = haLeft THEN
	LIB_libellé1.CadrageHorizontal = haRight
END
Syntax

Getting the horizontal alignment of a control Hide the details

<Current alignment>.HorizontalAlignment = <Control used>
<Current alignment>: Integer constant
Current horizontal alignment of the control. The possible values are as follows:
haCenterThe text is centered.
haJustifiedThe text is justified.
haLeftThe text is aligned to the left.
haNotDefinedAlignment defined by the CSS inheritance.
This constant is only available in WEBDEV.
haRightThe text is aligned to the right.
<Control used>: Control name
Name of the control to be used.

Changing 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 as follows:
haCenterThe text is centered.
haJustifiedThe text is justified.
haLeftThe text is aligned to the left.
haNotDefinedAlignment defined by the CSS inheritance.
This constant is only available in WEBDEV.
haRightThe text is aligned to the right.
Remarks
WINDEVReports and QueriesAndroidiPhone/iPadMac CatalystJavaUser code (UMC)

Horizontal alignment and text that overflows the control

If the text overflows the control, it will be displayed as follows:
  • In the report editor, the left part of the text is displayed.
  • In the window editor:
    • in a Static Text control, the right part of the text is displayed.
    • in an Edit control, the left part of the 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 gets and changes the horizontal alignment for the following types of controls:
  • Static Text control
  • Edit control
  • Combo Box control (standard or editable)
  • Check Box and Radio Button controls
  • List Box control
  • ListView control
  • Image control
  • Columns of Table and TreeView Table controls
  • Cells of a status bar
  • Bar Code control
  • Chart control
  • Progress Bar control. The property gets and sets the horizontal alignment of the percentage displayed in the progress bar.
  • Rating control
  • Organization Chart control
WEBDEV - Server code In a page, the HorizontalAlignment property gets and changes the horizontal alignment for the following types of controls:
  • Static and HTML Static controls
  • Edit control
  • Button control
  • Check Box and Radio Button controls
  • Table control and its columns
  • TreeView Table control and its columns
  • Table control cells (read-only)
  • Formatted display control
  • List Box and Combo Box controls
  • Looper control
  • HTML control
  • Link control
  • Pager control
  • Breadcrumb control
  • TreeView control
PHP In a PHP page, the HorizontalAlignment property gets and changes the horizontal alignment for the following types of controls:
  • Static and HTML Static controls
  • Edit control
  • Button control
  • Check Box and Radio Button controls
  • Table control and its columns
  • TreeView Table control and its columns
  • Formatted display control
  • List Box and Combo Box controls
  • Looper control
  • HTML control
  • Link control
  • Pager control
  • TreeView control
WINDEVWEBDEV - Server codeReports and QueriesAndroidiPhone/iPad In a report, the HorizontalAlignment property gets and changes the horizontal alignment for the following types of controls:
  • Static Text 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 can only be used in the following controls:
  • Static Text control.
  • Edit control.
  • Image control.
  • Check Box control.
  • Radio Button control.
  • List Box control.
  • Combo Box control.
  • Table columns (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 Text controls.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 10/31/2024

Send a report | Local help