I have a .net winforms ListBox and I've added items to it using .Add(). I change one of the objects in the list, such that it's ToString() method now returns a different value, but the display value of the item doesn't update. What do I need to call to tell the ListBox to re-read the ToString values?
2 Answers
Since you've added the items by hand, you'll need to clear the list box items, and re-add them.
When you add an item with .ToString(), the list box just has a copy of the string itself - it has no way to know that the item has changed, or that it was even based off an item. You'll have to handle this yourself.