I can't seem to change the DISPLAYED TEXT when I change the object behind
the selected index:
((MyObject)listbox.SelectedItem).mydisplayproperty = "abcdef";
The ListBox display doesn't change, but I know the object is changed since
other buttons that examine the contents of each listbox item see it changed
(and enable/disable their button state). How can I easily do this? I've
tried Refresh, Invalidate, Update methods on the listbox. No luck.
Amil
I'm not sure how to force ListBox to reread its items, but you can simulate the effect by adding and removing the item from the list
MyItem m = (MyItem)listBox1.SelectedItem;
m.MyText = "ABCD";
listBox1.Items.Insert(listBox1.SelectedIndex, m);
listBox1.Items.RemoveAt(listBox1.SelectedIndex);
The procedure shouldn't be noticable to the user.
--
Happy coding!
Morten Wennevik [C# MVP]