Topic: How to clear a form
Hello friends,
I have an image that acts as a button, like so:
procedure frmMain_add_person_btn_OnClick (Sender: TObject);
begin
frmAddPerson.ShowModal;
end;
I would like this button to open a clear form. When i use the tablegrid to edit a record and close the form, the form will open up again with all fields filled. The only solution is to my knowing to add a button in the form 'new record'.
I would like to open the form, if add_person_btn is clicked, with all components cleared. I know i can do it like this:
procedure frmMain_add_person_btn_OnClick (Sender: TObject);
begin
frmAddPerson.ShowModal;
frmAddPerson.Edit1.Clear;
frmAddPerson.Edit2.Clear;
etc...
end;
But i have a lot of components on the form, is there an easier way to clear them all in one time?
Thanks!