Alignment

This property returns and sets a value that determines the alignment of the text in an intrinsic control.

Syntax

control.Alignment [= number]

Parameters

control
Object expression that evaluates to a CheckBox, OptionButton, Label, or TextBox control.
number
Integer that specifies the type of alignment. The following table shows the settings for number for the CheckBox and OptionButton controls.
Constant
Setting
Description
vbLeftJustify 0 (default) Text is left-aligned; control is right-aligned.
vbRightJustify 1 Text is right-aligned; control is left-aligned.

The following table shows the settings for number for the Label and TextBox controls.
Constant
Setting
Description
vbLeftJustify 0 (default) Text is left-aligned.
vbRightJustify 1 Text is right-aligned.
vbCenter 2 Text is centered.

Remarks

The Alignment property is read-only for the CheckBox, OptionButton, and TextBox controls. If the MultiLine property setting of a TextBox control is False, text is always left-aligned.