〖〖 求教 〗〗winform中,我想移除Listbox中绑定后的某一项,请问怎么办?
yunok 2004-11-20 02:20:30 winform中,我想移除Listbox中绑定后的某一项,但是当移除最后一项的时候就报错(索引错误)
,代码如下:
绑定部分从Msdn上Copy下来的,绝对不会有问题:
Dim a As ArrayList = ListBox1.DataSource
a.Remove(ListBox1.SelectedItem)
ListBox1.DataSource = Nothing
ListBox1.DataSource = a
ListBox1.Refresh() '这句话加不加都没什么用
求教如何解决该问题?