delphi listbox 双击 items 事件

来源:百度知道 编辑:UC知道 时间:2024/07/03 03:37:59
delphi listbox 双击 items 事件
这个怎么写?

我想双击选中的item 就删除数据

在OnDblClick事件里写:self.ListBox1.DeleteSelected;就可以了

ListBox1.Items.Delete(ListBox1.ItemIndex);

procedure TForm1.ListBox1DblClick(Sender: TObject);
begin
ListBox1.Items.Delete(ListBox1.ItemIndex);
end;

这样应该就可以了,我试过