❔ How can I do this?
So you can add "tasks" to the listbox and when you press "verwijderen" it removes the items but when you press "terugzetten" it put's the last removed item back in the list. the items also have a background color that needs to be there when you press the undo button
8 Replies
so terugzetten is undo
what happens when you press terugzetten multiple times
yes
only needs to do the last removed item
so if you press terugzetten multiple times whath appens*
if you remove 1 item and press terugzetten it puts the 1 item back in the list
you press "verwijderen" the selected item is removed from the list you press "terugzetten" the item is back
I think I need to use a Stack<ListBoxItem> but no id how they work or what it is
You can use just a list and insert or remove values based on the index
A stack is like a pile of things. You put new things in top of the old ones and when you want to remove something, you have to start from the top.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.