In this post, you’ll learn more about the MainForm or DelphiVCL.Application.MainForm property that identifies the form in the application that is the main form.
The value of MainForm is the form that is the application’s main window. The main form is the first form created in the main body of the application by a call to CreateForm. When the main form closes, the application terminates. MainForm cannot be modified at runtime (it is read-only at runtime).
Learning more about the MainForm Property will help you to easily build Delphi VCL Applications using Python programming software.
Table of Contents
What else is there to know about DelphiVCL.Application.MainForm?
Note: By default, the form created by the first call to CreateForm in a project becomes the application’s main form. Before calling CreateForm, you can create as many forms as wanted by calling their own constructor.
Note: Before showing the MainForm, you can add a splash window. The MainForm will be shown after the initialization of the application finishes.
Let’s browse all the properties, methods, and built-in properties of the DelphiVCL.Application.MainForm using dir() command:
1 2 3 |
import DelphiVCL dir(DelphiVCL.Application.MainForm) |
What does the output of the MainForm example look like?
See the responses in our Windows command prompt:
You can also read short information about the DelphiVCL.Application.MainForm using the print() command:
1 2 |
print(DelphiVCL.Application.MainForm) print(DelphiVCL.Application.MainForm.__doc__) |
See the responses in our Windows command prompt:
Check out DelphiVCL which easily allows you to build GUIs for Windows using Python.