listview(50分)

J

jerjoan

Unregistered / Unconfirmed
GUEST, unregistred user!
我用listview.columns.add为listview加了三个列,然后用listview.items.add加项目,可是全都加在了第一列,怎么向其余的两列中加入元素??
 
用listitem.SubItems.add(s),参考一下:

var listitem:TListitem;
begin
with ConfigorForm do
begin

if CheckDest(FileName) then
begin
listitem:=FindListview.Items.Add;
if ImageIndex<>0 then listitem.ImageIndex:= GetImgIndex(FileName) else
listitem.ImageIndex := ImageIndex;
listitem.Caption := extractfilename(FileName);
listitem.SubItems.add(MyDir);
listitem.SubItems.add(MyGroup);
StrListSearch.Add(' 工作组:'+GroupFunc(MyGroup)+' 地址:'+MyDir+'/'+FileName);
end;
...
 
谢谢我接受答案了.
 
顶部