Returns or sets a value that determines the alignment of the text in a CheckBox or OptionButton control. Read-only at run time for CheckBox, OptionButton, and TextBox controls.
object.Alignment [= number]
The parts of the Alignment property syntax are described in the following table.
Part | Description |
---|---|
object | An object expression that evaluates to an object. |
number | An integer that specifies the type of alignment, as described in Settings. |
For CheckBox and OptionButton controls, the settings for number are described in the following table.
Constant | Setting | Description |
---|---|---|
vbLeftJustify | 0 | (Default). Text is left-aligned; control is right-aligned. |
vbRightJustify | 1 | Text is right-aligned; control is left-aligned. |
For Label and TextBox controls, the settings for number are described in the following table.
Constant | Setting | Description |
---|---|---|
vbLeftJustify | 0 | (Default). Text is left-aligned. |
vbRightJustify | 1 | Text is right-aligned. |
vbCenter | 2 | Text is centered. |
You can display text to the right or left of OptionButton and CheckBox controls. By default, text is left-aligned.
The MultiLine property in a Textbox control must be set to True for the Alignment property to work correctly. If the MultiLine property setting of a TextBox control is False, the Alignment property is ignored.