var
isdown: boolean = false;
procedure TForm1.ProgressBar1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if Button = mbleft then begin
isdown := true;
releasecapture;
with TProgressbar(Sender) do begin
Cursor := crHSplit;
application.ProcessMessages;
setcapture(handle);
end;
end;
end;
procedure TForm1.ProgressBar1MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
begin
with TProgressbar(Sender) do begin
if isdown then
Position := round(x * (ProgressBar1.Max - ProgressBar1.Min) /
ProgressBar1.ClientWidth + ProgressBar1.Min)
else Cursor := crDefault;
end;
end;
procedure TForm1.ProgressBar1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
isdown := false;
end;