Site icon Python GUI

Create a Specific Component using DelphiVCL.CreateComponent

software developer coding 500x333

DelphiVCL.CreateComponent is a function to create a specified component.

We call CreateComponent to create an instance of ComponentClass at the position specified by the Left and Top parameters with the size specified by the Width and Height parameters. The new component will be a child of the component specified by the Parent parameter.

We can browse all the properties, methods, and built-in properties of the DelphiVCL.CreateComponent  using dir() command:

[crayon-6605f89748700427229705/]

See the responses in command prompt:

Here is the working example of the implementation of DelphiVCL.CreateComponent to create a Main Panel inside your (previously created) basic form:

[crayon-6605f89748708417686247/]

Run the complete script, to get the following result:

[crayon-6605f8974870c933587626/]

The result:

We will talk more about the Main Panel or TPanel in the next Section.

 

Check out DelphiVCL which easily allows you to build GUIs for Windows using Python.

Watch this comprehensive introduction to Python GUI Development with DelphiVCL library video by Jim McKeeth:

Exit mobile version