filelistbox的问题,非常容易!!(0分)

S

samen

Unregistered / Unconfirmed
GUEST, unregistred user!
当filelistbox选择多个文件的时候,如何一个文件一个文件处理?就是如何分离每个文件名?
 
返回文件名是以分号隔开的,你自己写个函数把它们取出来不就得了。[:)]
 
如何取得那些选择的文件名称:用FILELISTBOX1.FILENAME好象不行。
 
for i:=0 to filelistbox1.count-1 do
if filelistbox1.Selected then
filelistBox1.Items //文件名
......
 
啊啊,搞错了,我当成opendialog了[:p]
 
看看帮助吧,这是帮助中的例子
var

F: File;
i: Integer;
begin
for i := 0 to (FileListBox1.Items.Count - 1) do begin
try
if FileListBox1.Selected then
begin
if not FileExists(FileListBox1.Items.Strings) then begin
MessageDlg('File: ' + FileListBox1.Items.Strings +
' not found', mtError, [mbOk], 0);
Continue;
end;
AssignFile(F, FileListBox1.Items.Strings);

Reset(F, 1);
ListBox1.Items.Add(IntToStr(FileSize(F)));
CloseFile(F);
end;
finally
{ do something here }
end;
end;
end;
 
顶部