ListBox post sorting event?

Hi there,

I’m using a Dictionary to index a ListBox content. It takes the string in the first column as the key and the row index as the value. In order to maintain the index accurate, I need to know when the ListBox has been sorted by the user, but it seems there is no event for that. I’m currently using a boolean flag set in the ListBox.SortColumn() Event. Each time a specific string is searched in the first column is searched the flag is tested and if it’s True, the index is rebuild. It works fine, but just out of curiosity, I’d like to know if there is a way to be advised when a ListBox is sorted?
Thanks.

We always use a timer with period 0, so it fires after the sorting finished.

It sounds like a good idea. I guess it should work with the new timer API call Xojo.Core.Timer.CallLater(). Where do you set up the timer? In the Listbox.SortColumn() event?

And it works fine from that event. Thank you Christian.

call later works, too.
But the timer can be reset each time, so on multiple calls you still have the timer fire once.