unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Borland.Vcl.StdCtrls, System.ComponentModel, Borland.Vcl.ExtCtrls;

type
  TForm1 = class(TForm)
    Splitter1: TSplitter;
    ListBox1: TListBox;
    ListBox2: TListBox;
    procedure ListBox2DragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure ListBox2DragDrop(Sender, Source: TObject; X, Y: Integer);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.nfm}

procedure TForm1.FormCreate(Sender: TObject);
var i :Integer;
begin
for i:=0 to 9 do
    begin
    ListBox1.Items.Add('Lista 1 : '+IntToStr(i));
    ListBox2.Items.Add('Lista 2 : '+IntToStr(i));
    end;
end;

procedure TForm1.ListBox2DragDrop(Sender, Source: TObject; X, Y: Integer);
var
  SenderLB,SourceLB :TListBox;
  punkt :TPoint;
  i :Integer;
begin
SenderLB:=Sender as TListBox;
SourceLB:=Source as TListBox;
punkt.X:=X;
punkt.Y:=Y;

for i:=SourceLB.Items.Count-1 downto 0 do
  if (SourceLB.Selected[i]) then
    begin
    SenderLB.Items.Insert(SenderLB.ItemAtPos(punkt,False),SourceLB.Items.Strings[i]);
    SourceLB.Items.Delete(i);
    end;
end;

procedure TForm1.ListBox2DragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
Accept:=false;
if (Source <> Sender) then Accept:=true;
end;

end.
