如题!
忘吝赐教!

解决方案 »

  1.   

    implementation{$R *.DFM}procedure TForm1.ListBox1MouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);beginif Button = mbLeft thenbeginListbox1.DragMode := dmManual;Listbox1.BeginDrag(False,-1);end;end;procedure TForm1.Label1DragDrop(Sender, Source: TObject; X, Y: Integer);beginif (Sender is TLabel) and (Source is TListBox) thenbeginwith Sender as Tlabel dobeginFont := (Source as Tlistbox).Font;Color := (Source as TlistBox).Color;Caption := (Source as TlistBox).Items[(Source as TlistBox).ItemIndex]end;end;end;procedure TForm1.Label1DragOver(Sender, Source: TObject; X, Y: Integer;State: TDragState; var Accept: Boolean);beginAccept := Source is TLIstBox;end;procedure TForm1.TreeView1DragOver(Sender, Source: TObject; X, Y: Integer;State: TDragState; var Accept: Boolean);beginAccept := Source is TLIstBox;end;procedure TForm1.TreeView1DragDrop(Sender, Source: TObject; X, Y: Integer);beginWith (Sender as TTreeView) dobeginGetNodeAt(X,Y).Text := (Source as TListBox).Items[(Source as TlistBox).ItemIndex];end;end;procedure TForm1.TreeView1DragDrop(Sender, Source: TObject; X, Y: Integer);beginWith (Sender as TTreeView) dobeginItemS.AddChild (GetNodeAt(X,Y),(Source as TListBox).Items[(Source as TlistBox).ItemIndex]);end;