> Then set the OnClick event for each button as Button1Click(Sender:TObject);

Which you can easily do if all buttons are owned by the form.

procedure TForm1.SetButtonEvents;
var
  i: Integer;
begin
  for i := 0 to ComponentCount - 1 do
   if Components[i] is TButton then
     TButton(Components[i]).OnClick := Button1Click;
end;

Just call SetButtonEvents in your forms OnCreate event.

cheers,
Jeremy

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to