有个属性是selected 比如你要显示被选中行的编号 你可以这样 var i: integerr;for i:=0 to listview1.rows.count-1 do if listview1.item[i].selected = true then showmessage(inttostr(i));
呵呵,还得靠自己呀 自己动手,丰衣足食仔细看了Delphi的E文Help后发现,应该这样: if listview1.selected<>nil then 选定了 else 没选定Tlistview.selected根本不是布尔型的
一楼不是说了?ListView1.Items[I].Selected可以处理多选的情况~~
你说的问题其实可以这样来判断,if Assigned(ListView.Selected) then ....
比如你要显示被选中行的编号
你可以这样
var
i: integerr;for i:=0 to listview1.rows.count-1 do
if listview1.item[i].selected = true then
showmessage(inttostr(i));
自己动手,丰衣足食仔细看了Delphi的E文Help后发现,应该这样:
if listview1.selected<>nil then 选定了 else 没选定Tlistview.selected根本不是布尔型的