L
lcl_003
Unregistered / Unconfirmed
GUEST, unregistred user!
我动态创建一个filelistbox让它获得一个目录下所有文件名,然后付给3个combobox,
代码如下:
procedure Trunselect.FormCreate(Sender: TObject);
var
flb:tfilelistbox;
i:integer;
a:Tobject;
begin
filepath:=ExtractFilePath(Application.ExeName);
flb:=tfilelistbox.create(self);
flb.mask:='*.*';
flb.parent:=self;
flb.directory:=filepath+'testlist/';
for i:=0 to flb.items.count-1 do
begin
combobox1.AddItem(flb.Items,a);
combobox2.AddItem(flb.Items,a);
combobox3.AddItem(flb.Items,a);
end;
flb.free;
end;
但是定义的a:Tobject;不知道有啥用?combobox.additem()里就的有个Tobject的参数,
Tobject是什么?
flb:=tfilelistbox.create(self);
这里的self是什么?
多谢了
代码如下:
procedure Trunselect.FormCreate(Sender: TObject);
var
flb:tfilelistbox;
i:integer;
a:Tobject;
begin
filepath:=ExtractFilePath(Application.ExeName);
flb:=tfilelistbox.create(self);
flb.mask:='*.*';
flb.parent:=self;
flb.directory:=filepath+'testlist/';
for i:=0 to flb.items.count-1 do
begin
combobox1.AddItem(flb.Items,a);
combobox2.AddItem(flb.Items,a);
combobox3.AddItem(flb.Items,a);
end;
flb.free;
end;
但是定义的a:Tobject;不知道有啥用?combobox.additem()里就的有个Tobject的参数,
Tobject是什么?
flb:=tfilelistbox.create(self);
这里的self是什么?
多谢了