begin
//選択されているときに処理を行う
if ListBox1.ItemIndex > -1 then
begin
//選択している文字列を取得
str := ListBox1.Items[ListBox1.ItemIndex];
//取得した文字列を追加
ListBox1.Items.Add(str);
end;

Label4.Caption := str;
begin
// APath内のディレクトリ内のファイルリスト作成
// [マイコンピュータ]等の特殊フォルダは指定しても無効
LFilesList := TDirectory.GetFiles(DirName);
for LFileName in LFilesList do
begin
ListBox1.Items.Add(TPath.GetFileName(LFileName));
end;
ListBox1.Items.EndUpdate;

end;
end;