Hola...
Como bien comentas, puedes hacer uso de la clase
TObjectList:
Código Delphi
[-]
var
NoteForm: TFrmVerNota;
begin
NoteForm := TFrmVerNota.Create(nil);
NoteForm.Caption := 'Something';
FNotes.Add(NoteForm)
end;
var
NoteForm: TFrmVerNota;
begin
NoteForm := FNotes[i] as TFrmVerNota;
NoteForm := TFrmVerNota(FNotes[i])
end;
Ahora, si usas
Delphi 2010 o superior, podrías usar la clase genérica TObjectList<T>:
Código Delphi
[-]
uses
Generics.Collections;
FNotes := TObjectList< TFrmVerNota > .Create;
FNotes.Add(TFrmVerNota.Create(nil));
FNotes[FNotes.Count - 1].Caption := 'Something';
FNotes[FNotes.Count - 1].Show
var
NoteForm: TFrmVerNota;
begin
NoteForm := TFrmVerNota.Create(nil);
NoteForm.Caption := 'Something';
NoteForm.Shot;
FNotes.Add(NoteForm)
end;
Sobre el liberar el formulario al cerrarlo, tendrías que usar el evento
OnClose poniendo el valor de la variable
Action en
caFree:
Código Delphi
[-]
procedure TFrmVerNota.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
FNotes.Remove(Self)
end;
type
TFrmVerNota = class(TForm)
private
FNotes: TObjectList< TFrmVerNota >; public
property FNotes: TObjectList< TFrmVerNota >
read FNotes
write FNotes;
end
FNotes.Add(TFrmVerNota.Create(nil));
FNotes[FNotes.Count - 1).Notes := FNotes;
FNotes(FNotes.Count - 1).Show
Espero que con esta pequeña explicación se resuelva tu problema.
Saludos...
Nota: Donde veas < TFrmVerNota > debes ponerlo todo sin espacios, esto lo hice así por que el foro elimina el contenido de <TFrmVerNota> si lo escribo todo junto.