unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Buttons, StdCtrls;type
  TForm1 = class(TForm)
    ListBox1: TListBox;
    ListBox2: TListBox;
    SpeedButton1: TSpeedButton;
    procedure FormCreate(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
var
 ch:'A'..'Z';
begin
for ch:='A' to 'Z' do
listbox1.Items.Add (ch);
end;procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
listbox2.Items.add (listbox1.items[listbox1.ItemIndex])
end;end.

解决方案 »

  1.   

    本程序的窗口:
    object Form1: TForm1
      Left = 192
      Top = 107
      BorderStyle = bsSingle
      Caption = 'Form1'
      ClientHeight = 131
      ClientWidth = 350
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      OldCreateOrder = False
      OnCreate = FormCreate
      PixelsPerInch = 96
      TextHeight = 13
      object SpeedButton1: TSpeedButton
        Left = 147
        Top = 16
        Width = 49
        Height = 25
        Caption = '---->'
        OnClick = SpeedButton1Click
      end
      object ListBox1: TListBox
        Left = 3
        Top = 5
        Width = 137
        Height = 121
        ItemHeight = 13
        TabOrder = 0
      end
      object ListBox2: TListBox
        Left = 202
        Top = 5
        Width = 145
        Height = 121
        ItemHeight = 13
        TabOrder = 1
      end
    end
      

  2.   

    listbox2.items.add(listbox1.items[listbox1.itemindex]);第二个问题应该是你的代码方面写错了,把按钮的代码贴出来看一下