Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread TListBox and changing data
Fri, May 24 2013 9:13 AMPermanent Link

Matthew Jones

I have a list box. I'd like to change the text of one of the items.

   lstTitles.Items[nIndex] := szNewText;
   
Unfortunately, this doesn't change the displayed item.
I tried a few functions like setting the ItemIndex to the ItemIndex (which should
call DoChange as I seem to have added that to the code), but it seems to cause some
other side effect. DataChanged and UpdateData didn't work either.

For now, this is working, but I don't like the requirement to change the content:

   lstTitles.Items.Remove(nIndex);
   lstTitles.Items.Insert(nIndex, szNewText);
   lstTitles.ItemIndex := nIndex;

If there was a Refresh or similar then I'd be happy with that. The ideal of course
is to change the list item and it auto-update, but the overhead is probably high
for that, compared to how often this requirement is needed. But some way to say
"I've changed the underlying data, please refresh" would be good.

Don't hold up the next update for it though!

/Matthew Jones/
Tue, May 28 2013 3:30 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< I have a list box. I'd like to change the text of one of the items.

   lstTitles.Items[nIndex] := szNewText;
   
Unfortunately, this doesn't change the displayed item. >>

I'll make sure this is fixed.

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com
Image