Delphi Learn About The InsertComponent Method And What It Does

FireWind

Свой
Регистрация
2 Дек 2005
Сообщения
1,957
Реакции
1,203
Credits
4,034
Learn About The InsertComponent Method And What It Does
By Muhammad Azizul Hakim October 26, 2021

InsertComponent or DelphiVCL.Application.InsertComponent method establishes the component as the owner of a specified component.

InsertComponent adds the component passed in the AComponent parameter to the end of the Components array property. The inserted component must have no name (no specified Name property value), or the name must be unique among all others in the Components list.

When the owning component is destroyed, AComponent is also destroyed.

Components are automatically inserted and removed when visually manipulating them in the form designer. Use InsertComponent when manually adding components to another Owner component’s Components list.

How to examine the properties and methods of DelphiVCL.Application.InsertComponent?​

Let’s browse all the properties and methodsof the DelphiVCL.Application.InsertComponent using dir() command:
Python:
import DelphiVCL
 
dir(DelphiVCL.Application.InsertComponent)
See the responses in our Windows command prompt:
1635247345351.png
You can also read short information about the DelphiVCL.Application.InsertComponent using the print() command:
Python:
print(DelphiVCL.Application.InsertComponent)
print(DelphiVCL.Application.InsertComponent.__doc__)
See the responses in our Windows command prompt:
1635247376128.png