Page 1 of 1

Change of control owner

PostPosted: Fri Apr 14, 2023 8:46 am
by Natter
Hi,

There are 2 controls on the window - a Tbutton and a TPanel. I need to tell the TButton that it belongs to the TPanel. How can this problem be solved ?

Re: Change of control owner

PostPosted: Fri Apr 14, 2023 8:52 am
by Antonio Linares
Dear Yuri,

When you create the TButton you use .. OF <TPanelObject>

Another way is to use Windows API function SetParent()
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setparent