I want to implement Parent/Child relationship with TControl and I mean to be able to have a TControl that can serve as a container for another TControl.
So far as I could see you can only do to that with TWinControl, why is that? and how I can make it to work for TControl?
I want to implement Parent/Child relationship with TControl and I mean to be able
Share
You need TWinControl to provide a drawing context (handle) and consequently to draw a control. That is how Windows works.
VCL allows controls that have no handle; these controls takes a handle from their parent. That is how VCL designed.
Theoretically you can design a library (VCL replacement or enhancement) that does not require a TControl to be parented by TWinControl, but you still need to obtain a handle somehow (from some TWinControl) to draw TControls without handle. I don’t see any benefits in such an approach, it just makes things more complicated.