先在Options中将ofAllowMultiSelect设置为True;
然后用OpenDialog1.Files读取数据;
例如:
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
listbox1.Items:=OpenDialog1.Files;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
listbox1.Items:=extractfilename(OpenDialog1.Files);
end;
但使用这些文件时(比如播放)一定要拼成全路径的文件名
倒,写错了,这样只能
procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
begin
if OpenDialog1.Execute then
begin
for i:=0 to opendialog1.files.count-1do
listbox1.Items.add(extractfilename(OpenDialog1.Files));
end
end;