In the previous examples, we already use the .SetProps several times (see Section 7: Getting Started with DelphiVCL III: Overview of Commonly used VCL Components).
Use SetProps to set specific properties to components.
Here are the working examples taken from the Section 7: Getting Started with DelphiVCL III: Overview of Commonly used VCL Components:
- Implemented in creating Main Panel:
1 2 3 |
# Main panel creation pnlMain = CreateComponent('TPanel',Owner) pnlMain.SetProps(Parent=self, Caption="",align = "alClient", Name = "MainPanel") |
- Label creation:
1 2 3 |
# Label creation lblCountry = CreateComponent('TLabel',pgOne) lblCountry.SetProps(Parent=pgOne,Caption='Country') |
- Listbox creation:
1 2 3 |
# Listbox creation lboxCountry = ListBox(pgOne) lboxCountry.SetProps(Parent=pgOne) |
- Datetime picker creation:
1 2 3 |
# Date time picker creation dtpDateofIssue = CreateComponent('TDateTimePicker',pgOne) dtpDateofIssue.SetProps(Parent=pgOne) |
- Combobox creation:
1 2 3 |
# Combobox creation cbxCity = ComboBox(pgOne) cbxCity.SetProps(Parent=pgOne,Name='ComboBox') |
- Radiogroup creation:
1 2 3 |
# Radiogroup Creation rbgRadioBox = RadioGroup(pgOne) rbgRadioBox.SetProps(Parent=pgOne,Caption='Gender') |
- Button creation:
1 2 3 |
# Button creation btnOK = Button(pgOne) btnOK.SetProps(Parent=pgOne,Caption = 'Submit',Name = 'btnOK') |
- Memo creation:
1 2 3 |
# Memo creation memoEvent = Memo(pgOne) memoEvent.SetProps(Parent=pgOne) |
- Rectangle shape creation:
1 2 3 |
# Rectangle shape creation shpRectangle = Shape(pgTwo) shpRectangle.SetProps(Parent=pgTwo,Shape = 'stRectangle') |
- Colorbox creation:
1 2 3 |
# Colorbox creation clbSelect = ColorBox(pgTwo) clbSelect.SetProps(Parent=pgTwo) |
Check out DelphiVCL which easily allows you to build GUIs for Windows using Python.