项目经验交流(CODE)
工作了两年,在以往的项目中,或多或少的会碰到一些技术上的难题,然后翻阅资料,直到解决,但好东东不该独享,虽然谈不上什么经典,但也许会解决大家日常中的燃眉之急吧 呵呵````````
用LISTVIEW显示表中的信息:
procedure viewchange(listv:tlistview;table:tcustomadodataset;var i:integer);
begin
tlistview(listv).Items.BeginUpdate;
try
tlistview(listv).Items.Clear;
with table do
begin
active:=true;
first;
while not eof do
begin
listitem:=tlistview(listv).Items.add;
listitem.Caption:=trim(table.fields[i].asstring);
listitem.ImageIndex:=8;
next;
end;
end;
finally
tlistview(listv).Items.EndUpdate;
end;
end;