代码:<br>procedure TForm1.ListBox1MouseDown(Sender: TObject; Button: TMouseButton;<br> Shift: TShiftState; X, Y: Integer);<br>begin<br> if Button = mbLeft then<br> begin<br> Listbox1.DragMode := dmManual;<br> Listbox1.BeginDrag(False,-1);<br> end;<br>end;<br><br>procedure TForm1.Label1DragDrop(Sender, Source: TObject; X, Y: Integer);<br>begin<br> if (Sender is TLabel) and (Source is TListBox) then<br> begin<br> with Sender as Tlabel do<br> begin<br> Font := (Source as Tlistbox).Font;<br> Color := (Source as TlistBox).Color;<br> Caption := (Source as TlistBox).Items[(Source as TlistBox).ItemIndex]<br> end;<br> end;<br>end;<br><br>procedure TForm1.Label1DragOver(Sender, Source: TObject; X, Y: Integer;<br> State: TDragState; var Accept: Boolean);<br>begin<br> Accept := Source is TLIstBox;<br>end;<br><br>procedure TForm1.TreeView1DragOver(Sender, Source: TObject; X, Y: Integer;<br> State: TDragState; var Accept: Boolean);<br>begin<br> Accept := Source is TLIstBox;<br>end;<br><br>procedure TForm1.TreeView1DragDrop(Sender, Source: TObject; X, Y: Integer);<br>begin<br> With (Sender as TTreeView) do<br> begin<br> GetNodeAt(X,Y).Text := (Source as TListBox).Items[(Source as TlistBox).ItemIndex];<br> end;<br>end;<br><br>end.<br>