拖动事件确实没有,但可以用down,move,up拼起来。
举个最简单的例子吧.
var mouselbstate:boolean;
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if button=mbleft then
begin
mouselbstate:=true;
canvas.MoveTo(x,y);
canvas.LineTo(x,y);
end;
end;
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if button=mbleft then
mouselbstate:=false;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if mouselbstate then
canvas.LineTo(x,y);
end;