procedure TForm1.Button2Click(Sender: TObject);
var
str : string;
i : integer;
begin
if ListBox1.SelCount > 0 then
for i:= 0 to ListBox1.Items.Count - 1 do
begin
if ListBox1.Selected[i] = True then
begin
//選択している文字列を取得
str := ListBox1.Items[i];
//取得した文字列を追加
ListBox2.Items.Add(str);
end;
end;
end;
|