G
Guest
Hello,
I've run into a brick wall in working with a standard ListBox. I'm loading
lightweight objects into a ListBox component - call them Elements. The
Element class has an ElementName property and an overridden ToString() method
that displays the ElementName. When I load Elements into my list box Items
collection, the ElementName displays and all is well. My problem occurs
when I change an ElementName property programatically. The underlying
Element does indeed change, but I can't get the text displayed the list box
to reflect it! I can delete and re-add the Element and the change will show
up, but neither ListBox.Update() nor ListBox.Refresh() change it.
I've considered a custom draw method (which I may have to implement anyway).
But is there another way of changing the text I'm overlooking? I'm not
using data binding - can a ListBox programatically bind to its own Items
collection?
Any help appreciated.
Thanks much
Jim Stanley
Media Services, Inc.
I've run into a brick wall in working with a standard ListBox. I'm loading
lightweight objects into a ListBox component - call them Elements. The
Element class has an ElementName property and an overridden ToString() method
that displays the ElementName. When I load Elements into my list box Items
collection, the ElementName displays and all is well. My problem occurs
when I change an ElementName property programatically. The underlying
Element does indeed change, but I can't get the text displayed the list box
to reflect it! I can delete and re-add the Element and the change will show
up, but neither ListBox.Update() nor ListBox.Refresh() change it.
I've considered a custom draw method (which I may have to implement anyway).
But is there another way of changing the text I'm overlooking? I'm not
using data binding - can a ListBox programatically bind to its own Items
collection?
Any help appreciated.
Thanks much
Jim Stanley
Media Services, Inc.