Method

Graphics.StringDirection


Warning

This item was deprecated in version 2019r2. Please use Graphics.TextDirection as a replacement.

Description

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

Notes

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, it will return -1; otherwise it will return either 0 for left to right or 1 or right to left.

There are three class constants that you can use to test the string direction:

Class Constant

Value

TextDirectionUnknown

-1

TextDirectionLeftToRight

0

TextDirectionRightToLeft

1

Sample code

This example gets the string direction.

Dim i As Integer
i = g.StringDirection("Hello world")

Compatibility

All project types on all supported operating systems.