En ese caso concreto no vale mi respuesta, ¡tenías que poner la excepción que cumple la regla!
La función a ejecutar debe estar definida dentro del Frame. InsertControl (en este caso concreto) pertenece a la ventana donde será insertada el frame. Tu código es equivalente a :
Código Delphi
[-]
Form1.InsertControl(Frame)
que podría ejecutarse así:
Código Delphi
[-]
constructor TFrame.create(AOWner:TComponent);
begin
inherited;
self.Parent := AOWner;
end;
Cita:
Empezado por Ayuda de InsertControl
Applications should not need to call InsertControl directly. Child controls are automatically inserted and removed when added or deleted at design time. At runtime, use the Parent property of the child control to insert it in the Controls array. I
|
Saludos