How to get a component's parent form in Borland VCL?

Posted by nklein on Stack Overflow See other posts from Stack Overflow or by nklein
Published on 2010-05-28T11:03:00Z Indexed on 2010/05/28 11:11 UTC
Read the original article Hit count: 199

Filed under:
|
|

Hi,

I'd like to determine which form a given component belongs to in my application. Neither the Parent nor the Owner property can be assumed to be the form itself, so I can't simply use this.

I guess I could just go through the Parent property recursively until I arrive at something derived from TForm, but is there a better way to do this? I used the search function, but couldn't find anything specific to my problem.

I'm using Borland C++ Builder, by the way (tagged Delphi because a majority of VCL users seem to write in Delphi, and I read Delphi code just fine).

Thanks in advance!

© Stack Overflow or respective owner

Related posts about c++

Related posts about delphi