From Xojo Documentation

Revision as of 15:31, 7 October 2019 by PLefebvre (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Graphics.TextDirection(text As String) As TextDirections

New in 2019r2

Supported for all project types and targets.

Returns an Enumeration that indicates the direction in which the text is written.


This is useful for non-Roman systems, especially Middle-Eastern languages. If you pass an empty string, it returns the system default string direction. If this function is not supported on the user's system, the Graphics.TextDirections value will be Unknown.

Sample Code

This example gets the string direction.

If g.TextDirection("Hello world") = Graphics.TextDirections.RightToLeft then
MessageBox("We are on a right to left system.")
End If