Parent / child relationship with TControl

I want to use the Parent / Child relationship with TControl, and I want to have TControl, which can serve as a container for another TControl. As far as I could see, you can only do this with TWinControl, why? and how can I make it work for TControl?

+3
source share
4 answers

You need a TWinControl to provide a drawing context (handle) and therefore to draw a control. This is how Windows works.

VCL allows you to control controls without a handle; these controls take a handle from their parent. That is how VCL is designed.

( VCL), , TControl TWinControl, - ( TWinControl) TControls . , .

+3

, , , ? , , TWinControl. Windows, VCL, , HWND. TWinControl: , TControl .

0

, . , . , - , TGraphicControl , , IDE "", TWinControls , , , IDE , .

, , TControl , TWinControl.

0

TWinControl has its own drawing screen (this OS). Non-Win TControl does not, it draws in the parent context. Thus, only TWinControl can be the parent, use it instead of TControl.

0
source

Source: https://habr.com/ru/post/1756298/


All Articles