The Alignment or TAlignment property is used to specify how text is aligned within a control. The default value of the Alignment property is taLeftJustify
.
These are the possible values of Alignment:
Value | Meaning |
taLeftJustify | Align text on the left side of the header section. |
taCenter | Center text in the header section. |
taRightJustify | Align text on the right side of the header section. |
Here is the working example of the implementation of Alignment in CheckBox creation:
1 2 3 4 5 6 |
# Checkbox creation chkSingle = CheckBox(self) chkSingle.Parent = pgOne chkSingle.Caption = 'Single ?' chkSingle.Alignment = 'taLeftJustify' chkSingle.SetBounds(20, 44, 141, 30) |
Table of Contents
Is there a complete code example of how to align text in my Python code?
Yes, see the following complete code example.
Check out DelphiVCL which easily allows you to build GUIs for Windows using Python.