Sorry that I misunderstood your previous post..
OK, another approach:
You should probably share the OnChange, not the OnClick event (user may change the value of your spinedit by other means than the mouse).
On your first spinedit double click the OnChange event, to create the method stub.
You should now have a procedure added to your form's declaration (SpinEdit1Change),
Add a new method to the private section, DoSomething passing the spinedit as a parameter.
Add a new variable to the private section that is a TSpinEdit.
In OnChange method, set the Activespinedit variable to the spinedit that called the OnChange Method. Then Call the DoSomething Method passing that spinedit.
In your object inspector, set ALL the other spinedits onChange event to point to the same SpinEdit1Change, instead of creating a new one. Clicking where the method name is, drops down a list of methods you can select from, select SpinEdit1Change...
Now all your spinEdits, will execute SpinEdit1Change when changed, and your onChange should be able to figure out which spinedit was the active component.
Code:
Form1 = class(TForm)
procedure SpinEdit1Change(Sender: TObject);
private
ActiveSpinEdit: TSpinEdit;
procedure DoSomething(SE: TSpinEdit);
end;
procedure TForm1.SpinEdit1Change(Sender: TObject);
begin
ActiveSpinEdit := TSpinEdit(Sender);
DoSomething(ActiveSpinEdit);
end;
procedure TForm1.DoSomething(SE: TSpinEdit);
begin
SE.<property> := <newValue>;
end;
Also, very important, do not change the value of your spin edit within the OnChange or DoSomething. It will start an infinite loop going.