Runtime design - saving and loading a layout form (recursively?)

I am creating an application whose layout should be fully customizable on the client side. This means that each component (control) can be changed and moved in form, new controls can be added or removed. I would like to use the JVCL Runtime Design (Design Surface and Object Inspector).

The problem is storing and loading the form. TStream. WriteComponent does not support recursive writing, which means that it only retains the "first level" components.

So, for example, if I put a TPanel on the form, then TButton on the panel and calls WriteComponent on the form, only the TPanel will be saved, not the TButton.

My question is * how can I use WriteComponent to keep the control hierarchy complete ?

+6
source share
1 answer

You must make the form the Owner of all components, even if the Parent is different. For your example, the button and panel should belong to the form.

+11
source

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


All Articles