Hi!
I’ve tried doing this in different ways, but I can’t find a way for it to work.
I have an array of TLabel called Termin which goes from 0 to length of another array. The Labels in array Termin are created dynamically. I want to open a new form when I click on a label.
for f:=0 to high(Termin) do
begin
Termin[f].OnClick := @Form4.ShowDetails;
end; This is the procedure which opens, when I click on a label:
procedure TForm4.ShowDetails(Sender:TObject);
begin
Alldays1 := i; //Alldays1 and Alldays2 are sent to form5 to show the contents of a record
Alldays2 := f;
Form5.Show;
end; When I run the program and click on a label, form5 opens and shows the contents of a record, that belongs to Termin[highTermin].
This makes sense, because the program runs f from 0 to high(Termin). When I click on a label, f is already high(Termin). Does anybody know how I can tell the program, which label I clicked on?
Thank you for you help!