c#中listbox中选中某一行,如何将它删除

来源:百度知道 编辑:UC知道 时间:2024/06/22 11:53:52

ListBox.Items.RemoveAt(Index)
Index是行号(0开始)

ListBox.Items.RemoveAt(ListBox.SelectIndex)
是删除当前选中的行(注意保证SelectIndex>=0)

字里面不是有一个Items属性吗,里面就可以指定到哪一行,然后再用remove就行了。