I'm working with someone else's code, and I'm adding a new form
So, I've created the form and I can open it, use the buttons and list, etc, but I'm having a problem doing things on formcreate.
I make the form by doing this:
procedure TModelForm.RepeatOpen(Sender: TObject);
var
DefForm : TForm5;
begin
DefForm := TForm5.Create(Self);
Self.Visible := False;
try
DefForm.ShowModal;
finally
Self.Visible := True;
DefForm.Release;
end;
end;
in my TForm5, I have a procedure
procedure TForm5.FormCreate(Sender: TObject);
begin
inherited;
RunList := CModelList.Create;
RunList.ReadData;
RunList.FillList(ListBox1.Items);
end;
but it doesn't do anything
I also have
procedure TForm5.PopulateListClick(Sender: TObject);
begin
RunList := CModelList.Create;
RunList.ReadData;
RunList.FillList(ListBox1.Items);
end;
which is assigned to a button, and this actually works and populates my ListBox
I've been looking it up online and it seems like there is no OnCreate function, there is a way to override it but it seems like there should be a way to just define what happens when the frame is first created
also, the reason I'm using FormCreate is because that's what the code I'm working with is doing, and it seems to be working
Thanks!