I tried to create a subform in a HTMLDiv of a main form, and it works perfectly :
frm := TSubForm1.CreateNew(HTMLDiv1.ElementID, @AfterCreate);
But how to add a procedure called when this subform is closed or destroyed? For popup forms, the following code exists :
newform := TForm2.CreateNew(@AfterCreate);
But for a form hosted in a control, I can't find any solution.
I'd like to have a "close" button in the subform. And after closing this subform, the mainform can execute code to create another subform of another type in the same place.