相关代码 |
|
listview的使用方法:(利用过程) procedure Tmainfrm.addbookinfo(var q:Tquery;var v:Tlistview;flg:integer); begin q.first; while not q.eof do begin with v.items.add do begin caption:=q.fieldbyname('图书编号').asstring; subitems.add(q.fieldbyname('书名').asstring); subitems.add(q.fieldbyname('作者').asstring); end; q.next; end; end; book_no:=v.selected.caption;//取到相应的caption b_out:=v.selected.subitems[4];//找到自已的第四个子项值