procedure TForm1.ListBox1DragOver(Sender, Source: TObject;
X, Y: Integer;
State: TDragState;
var Accept: Boolean);
begin
Accept := Source is TLabel;
end;
This OnDragDrop event handler implements the drop behavior.
procedure TForm1.ListBox1DragDrop(Sender, Source: TObject;
X, Y: Integer);
begin
if (Sender is TListBox) and (Source is TLabel) then
begin
with Sender as TListBoxdo
begin
Font := (Source as TLabel).Font;
Color := (Source as TLabel).Color;
end;
end;
end;
delphi得sample