A
admin2008
Unregistered / Unconfirmed
GUEST, unregistred user!
现在数据库的用户名是显示在listview 可是图像不能显示 listview属性largeimages设置成imagelist1 代码是这样的
procedure TForm1.FormCreate(Sender: TObject);
var list1:Tlistitem;
i:integer;
begin
with adoquery1 do
begin
close;
sql.Clear ;
sql.Text:='select * from user';
open;
first ;
end;
while not adoquery1.Eof do
begin
list1:=listview1.Items.Add ;
// i:=listview1.ItemIndex;
list1.ImageIndex:=i;
list1.Caption:=adoquery1.fieldByName('user_name').AsString ;
adoquery1.Next ;
inc(i);
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
var list1:Tlistitem;
i:integer;
begin
with adoquery1 do
begin
close;
sql.Clear ;
sql.Text:='select * from user';
open;
first ;
end;
while not adoquery1.Eof do
begin
list1:=listview1.Items.Add ;
// i:=listview1.ItemIndex;
list1.ImageIndex:=i;
list1.Caption:=adoquery1.fieldByName('user_name').AsString ;
adoquery1.Next ;
inc(i);
end;
end;