Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Owner,Parent,Self,Sender,Clientheight,Height (transfer)

Shulou Source: shulou.com Published: 2022-06-01 01:40:21 10月05日 Update

The Parent property refers to the package container of the component, and the component can only be displayed and moved within this range.

The Owner property refers to the owner of the component, which is responsible for the creation and release of the component. The create method should take parameters that represent the component owner, as in the above example, the component owner is the form, that is, self. The Parent property and the Owner property are run-time properties and can only be set at run-time, through code.

Owner is the creator, Parent is the container, and they have different types.

Owner is TComponent (component), Parent is TWinControl (form control)

Function A1 (B:Integer): Integer

Begin

……

Button:=tbutton.create (self);.

End

Third, the difference between Clientheight and Height,Clientwidth and Width:

For general artifacts, Height is Clientheight,Width and Clientwidth, while for forms, Height is the height, including the title bar, and Clientheight is the height of the form's workspace. Similarly, Clientwidth specifies the width of the form's workspace.

As you can see from the above statement, understanding the difference between Ower and Parent,Self and Sender,Clientheight and Height,Clientwidth and Width is important for proper programming in Delphi.

[@ more@]

Tags: Component property form owner that is workspace phase height work run different important code component creator parameter container width control method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia macOS MariaDB Linux Xiaomi