Removing ListBox item.
Posted: 23 Sep 2013, 18:08
Hey there! Fast question I figured more people would run into sooner or later anyway.
I have a listbox that I populate with code.
And then when I want to remove one of the items, I'm unsure on how to go about that!
Here's the code I'm using right now, and it doesn't seem to remove the item. In fact it does absolutely nothing (in terms of removing, everything else is just fine).
I have a listbox that I populate with code.
And then when I want to remove one of the items, I'm unsure on how to go about that!
Here's the code I'm using right now, and it doesn't seem to remove the item. In fact it does absolutely nothing (in terms of removing, everything else is just fine).
Code: Select all
ListBoxItem itemToDelete = _characterList.GetSelectedItem().As<ListBoxItem>();
// Do some magic stuff here, unimportant. But it Does use the button and actually verifies that the button reference is correct.
// Nothing happens when I call Dispose. Wrong function?
_characterList.GetSelectedItem().Dispose();