Hey there
I've got a problem, i don't know how i can assign a function to a button in an array.
my function:
iButtons := iButtons+1;
setlength(Buttons,length(Buttons)+1);
Buttons[iButtons] := TButton.Create(nil);
Buttons[iButtons].Caption := SLFeldListe[i];
Buttons[iButtons].Parent := panels[i];
Buttons[iButtons].Left := 200;
Buttons[iButtons].Top := round(((panels[i].Height)/2)-((Buttons[iButtons].Height)/2));
TButton(Buttons[iButtons]).OnClick := @ButtonVerkaufpreisClick;
on the line
TButton(Buttons[iButtons]).OnClick := @ButtonVerkaufpreisClick;
fbc gives me an error:
Unitdynamischedarstellung.pas(309,57) Error: Incompatible types: got "<address of local procedure(TObject);Register>" expected "<procedure variable type of procedure(TObject) of object;Register>"
what am i doing wrong?
thank you very much
greets andrew