In the OnShow method, OnShow need to find out the name of the form (form component) with which the current form was opened.
In the first form:
Form2.Show; In the second:
procedure TForm2.FormShow(Sender: TObject); begin if Sender = Form1.Button then... Alas, does not work. Sender is empty.
Senderequal - Grundy