〖 〖骷髅〗 Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-13 #1 我用LISTVIEW做用数据库的显示,当我选中其中一个记录想删除时,他却老是删除最后一条记录 ,请问如何实现我选中那条记录就删那条记录呢?非常感谢~
F forss Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-13 #3 listview有一个selected的属性,用上了么?
L ljsoft Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-13 #4 当你选中某记录时,记住该记录的sID, delete from 数据表 where id=sID
L linsb Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-13 #5 procedure TForm1.ListView1DblClick(Sender: TObject); begin if listview1.Selected = nil then Exit; Num:=ListView1.ItemIndex; ListView1.Items.delete(ListView1.ItemIndex); end;
procedure TForm1.ListView1DblClick(Sender: TObject); begin if listview1.Selected = nil then Exit; Num:=ListView1.ItemIndex; ListView1.Items.delete(ListView1.ItemIndex); end;