>User clicks on a list. The item on which he clicked is highlighted. A message box appears. User responds to the message box. The message box disappears. The value of the list and the highlighted item are not in sync.
>
>If you think this is regular UI or if you're ok with events triggered by an user explicit action being "eaten away" after they occur, like they never happened, then good for you.
>
>It's not good for me.
Perhaps you could track, in the debugger, the moment when the highlighted item in the listbox changes, and the value of its .listindex, .value and perhaps the .selected[.listindex] and if .displayvalue has any meaning in a listbox, that too. Watch them as they were before the messagebox(), then step by step afterwards. Perhaps you'll catch something. Though, as in all things focus-related, the debugger has the focus and the rest of the focus behavior is more or less simulated.
A thing I'd try: after messagebox(), listbox.setfocus() (unless all of this is happening in a .valid(), then you can't do this).