Back to Devexpress

Right-to-Left Layout

vcl-405028-expresscrossplatformlibrary-global-application-settings-right-to-left-layout.md

latest3.2 KB
Original Source

Right-to-Left Layout

  • Dec 17, 2024

Certain languages, such as Hebrew or Arabic, use a right-to-left (RTL) writing system that requires a mirrored UI layout and a reversed text direction.

Enable RTL Layout

To use RTL display mode in an application or control, assign bdRightToLeft to the application’s BiDiMode property or the control’s BiDiMode property. You can use the ParentBiDiMode property to specify if the control uses its parent’s display mode.

Code Example: Enable RTL Application-Wide

The following code example enables the RTL layout for all controls that support it:

delphi
begin
  Application.BiDiMode := bdRightToLeft;
  // ...
  Application.Initialize;
  Application.MainFormOnTaskBar := True;
  Application.CreateForm(TMyForm, MyForm);
  Application.Run;
end.
cpp
#include <vcl.h>
#pragma hdrstop
#include <tchar.h>
//-------------------------------------------------------------------------------
USEFORM("Unit1.cpp", TMyForm);
//-------------------------------------------------------------------------------
int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
{
  try
  {
    Application->BiDiMode = bdRightToLeft;
    // ...
    Application->Initialize();
    Application->MainFormOnTaskBar = true;
    Application->CreateForm(__classid(TMyForm), &MyForm);
    Application->Run();
  }
  // ...
}

Controls with Support for RTL

All DevExpress controls in the following list can switch between left-to-right and right-to-left layouts:

See Also

Global Application Settings