unit fmulti;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TfrmMulti = class(TForm)
    lstTop: TListBox;
    lstBottom: TListBox;
    cmdTransfer: TButton;
    cmdClear: TButton;
    cmdClose: TButton;
    procedure FormCreate(Sender: TObject);
    procedure cmdCloseClick(Sender: TObject);
    procedure cmdTransferClick(Sender: TObject);
    procedure cmdClearClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmMulti: TfrmMulti;

implementation

{$R *.DFM}

procedure TfrmMulti.FormCreate(Sender: TObject);
begin
  with lstTop.Items do
  begin
    Add ('Acme Pavers');
    Add ('Belding and Associates');
    Add ('Banyan II, Inc.');
    Add ('Feldspar, Feldspar, and Feldspar');
    Add ('Gold Dusters Housecleaning');
    Add ('MS Brothers Bakery');
    Add ('Northwind Traders');
    Add ('Sandor Cinemas');
    Add ('Tastings Catering');
    Add ('Tang and Ng, CPAs');
  end;
end;

procedure TfrmMulti.cmdCloseClick(Sender: TObject);
begin
  Close;
end;

procedure TfrmMulti.cmdTransferClick(Sender: TObject);
var
  i: integer;
begin
  for i := 0 to lstTop.Items.Count -1 do
    if lstTop.Selected[i] then
      lstBottom.Items.Add (lstTop.Items.Strings[i]);

  cmdClear.Enabled := True;
end;

procedure TfrmMulti.cmdClearClick(Sender: TObject);
begin
  lstBottom.Clear;
  cmdClear.Enabled := False;
end;

end.
