Removing ListBox item.
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();
-
sfernandez
Site Admin
- Posts: 3095
- Joined:
Re: Removing ListBox item.
Code: Select all
_characterList.GetItems().Remove(_characterList.GetSelectedItem());
Who is online
Users browsing this forum: Ahrefs [Bot] and 3 guests