我要在combobox中显示出某一个文件夹下面的所有文件,并且这个文件夹下的文件是变动的,我采用这样的方式显示,代码如下:
const systemdir='F:\program\designreport\reportrtm\';
procedure TForm1.combobox1Click(Sender: TObject);
var filename:string;
force:string;
begin
force:=extractfilename(systemdir+filename);
if combobox1.Items.IndexOf(force)<0 then
combobox1.Items.Add(force);
end;
但是这样好象不行啊请高手指教!!!!!
const systemdir='F:\program\designreport\reportrtm\';
procedure TForm1.combobox1Click(Sender: TObject);
var filename:string;
force:string;
begin
force:=extractfilename(systemdir+filename);
if combobox1.Items.IndexOf(force)<0 then
combobox1.Items.Add(force);
end;
但是这样好象不行啊请高手指教!!!!!
你的filename有内容么?
你想要个什么功能
用windows api里的findExists函数,查询你指定的目录……