DelphiDelphiVCLPythonPython GUIWindows

How to use the Parent Property

This Is The DelphiVCLApplicationModalFinished Method

We use the Parent property to get or set the parent of the control. The parent of a control is the control that contains it. For example, if an application includes three radio buttons in a group box, the group box is the parent of the three radio buttons, and the radio buttons are the child controls of the group box.

To serve as a parent, a control must be an instance of a TWinControl descendant.

When creating a new control at run time, assign a Parent property value for the new control. Usually, this is a form, panel, group box, or a control that is designed to contain another. Changing the parent of a control moves the control onscreen so that it is displayed within the new parent. When the parent control moves, the child moves with the parent.

Some controls (such as ActiveX controls) are contained in native windows rather than in a parent VCL control. For these controls, the value of Parent is nil (Delphi) or NULL (C++) and the ParentWindow property specifies the window.

Note: The Parent property declared in TControl is similar to the Owner property declared in TComponent, in that the Parent of a control frees the control just as the Owner of a component frees that component. However, the Parent of a control is always a windowed control that visually contains the control, and is responsible for writing the control to a stream when the form is saved. The Owner of a component is the component that was passed as a parameter in the constructor and, if assigned, initiates the process of saving all objects (including the control and its parent) when the form is saved.

Here is the working example of the implementation of Parent in the main panel creation:

 

Here is the working example of the implementation of Parent in the page control creation:

 

Here is the working example of the implementation of Parent in the label creation:

 

Here is the working example of the implementation of Parent in the edit box creation:

 

Here is the working example of the implementation of Parent in the check box creation:

 

Here is the working example of the implementation of Parent in the list box creation:

 

Here is the working example of the implementation of Parent in the datetime creation:

 

Here is the working example of the implementation of Parent in the combo box creation:

 

Here is the working example of the implementation of Parent in the radiogroup creation:

 

Here is the working example of the implementation of Parent in the button creation:

 

Here is the working example of the implementation of Parent in the memo creation:

 

Here is the working example of the implementation of Parent in the shape creation:

 

Here is the working example of the implementation of Parent in the color box creation:

 

Here is the working example of the implementation of Parent in the draw grid creation:

 

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

Related posts
CodeIDEProjectsPythonWindows

Unlock the Power of Python for Deep Learning with Generative Adversarial Networks (GANs) - The Engine behind DALL-E

CodeIDELearn PythonPythonPython GUITkinter

How To Make More Than 20 ChatGPT Prompts Work With Python GUI Builders And Matplotlib Library?

CodeIDELearn PythonPythonPython GUITkinter

How To Make More Than 20 ChatGPT Prompts Work With Python GUI Builders And Pillow Library?

CodeDelphiDelphiFMXLearn PythonProjectsPythonPython GUI

How To Create A Weather App With The Python Delphi Ecosystem and Weatherstack API

Leave a Reply

Your email address will not be published. Required fields are marked *