ListBox Item Removal

I am trying to figure out how to Remove Items from a listbox, according to all the information I have found the following code should work, but nothing happens?
1
2
3
4
private: System::Void button6_Click(System::Object^  sender, System::EventArgs^  e) {
			 listbox->Items->Remove(listbox->SelectedItems);
			 
		 }


I can remove a single Item by using SelectedItem instead, but that seems to defeat the functionality of the listbox class.
Last edited on
I'd like to know the answer to this one too, I was thinking something along the lines of...

1
2
3
4
5
6
7
	
POSITION pos = list.GetFirstSelectedItemPosition();
while(pos != NULL)
{
   int nItem = list.GetNextSelectedItem(pos);
   list.delete(nItem)
}


Would that work?
Topic archived. No new replies allowed.