Quote Originally Posted by Uwe S.
but where exactly must I place this code?
At Frame action?
Yes, you attach the code to a frame where the listbox exists.

You will also have to set the onChange handler of the listbox to do something when the selection changes. You can do that using the gui's onChange parameter or integrate it into the code example.