I have two forms. Each form has a button to jump to another form.
How to make it so that when switching to another form, the latter nullifies all its variables and objects on it, in other words, it is updated. I wrote this code.
procedure TForm1.Panel8Click(Sender: TObject); begin Form1.Hide; Application.CreateForm(TForm2, Form2); Form2.Show; end; The idea is that when you click on a button, Form2 should be created anew, but for some reason, the variables on it, if they were changed before, retain their values.