procedure LoadIcon(IconPath:string;var ImageList:TImageList); var sr: TSearchRec; FileAttrs: Integer; Path:string; i : integer; BitMap1 : TBitMap; begin i := 0; ImageList.Clear; path:=IconPath+'*.bmp'; if FindFirst(path, 0, sr) = 0 then begin BitMap1 := TBitMap.Create; i := i+1; BitMap1.LoadFromFile(IconPath+IntToStr(i)+'.bmp'); ImageList.Add(BitMap1,nil); while FindNext(sr) = 0 do begin i := i+1; try BitMap1.LoadFromFile(IconPath+IntToStr(i)+'.bmp'); ImageList.Add(BitMap1,nil); except continue; end; end; end; end;
var
sr: TSearchRec;
FileAttrs: Integer;
Path:string;
i : integer;
BitMap1 : TBitMap;
begin
i := 0;
ImageList.Clear;
path:=IconPath+'*.bmp';
if FindFirst(path, 0, sr) = 0 then
begin
BitMap1 := TBitMap.Create;
i := i+1;
BitMap1.LoadFromFile(IconPath+IntToStr(i)+'.bmp');
ImageList.Add(BitMap1,nil);
while FindNext(sr) = 0 do
begin
i := i+1;
try
BitMap1.LoadFromFile(IconPath+IntToStr(i)+'.bmp');
ImageList.Add(BitMap1,nil);
except
continue;
end;
end;
end;
end;