Skip to content

TextAlign

Returns the container's preferred text alignment, as an Integer. Read-only.

Syntax: object.TextAlign

object
required An object expression that evaluates to an AmbientProperties object.

A control that displays text and does not have its own alignment explicitly set should align its text according to this hint. The value follows the standard OLE control alignment enumeration:

ValueMeaning
0General --- numeric values right-aligned, text left-aligned
1Left-aligned
2Centred
3Right-aligned
4Fill

Example

This example responds to a TextAlign change and repaints the control with the updated alignment.

vb
Private Sub UserControl_AmbientChanged(PropertyName As String)
    Select Case PropertyName
        Case "TextAlign"
            UserControl.Refresh    ' repaint with updated text alignment
    End Select
End Sub

See Also

twinBASIC and LOGO copyright of "WaynePhillipsEA" author