procedure lbMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure lbMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure lbMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
isdown:boolean;
source:integer;
target:integer;
procedure Tripmain.lbMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
source:=lb.ItemAtPos(point(x,y),false);
isdown:=true;
end;
procedure Tripmain.lbMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
isdown:=false;
end;
procedure Tripmain.lbMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if isdown then
begin
target:=lb.ItemAtPos(point(x,y),false);
if (source<>target) and (target>=0) then
begin
lb.Items.Exchange(target,source);
source:=target;
end;
end;
end;