procedure TForm1.Button1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Button1.Tag := 1;
repeat
Caption := Caption + '1';//Do something you want here
Application.Processmessages;
until Button1.Tag = 0;
end;
procedure TForm1.Button1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Button1.Tag := 0;
end;