For example, this code:
... PUBLIC SUB MyTextBox_GotFocus() PRINT "GotFocus" END PUBLIC SUB MyButton_Click() MyTextBox.SetFocus PRINT "Click" END ...
prints the following when you click on the button MyButton:
Click GotFocus
The MyTextBox_GotFocus event handler is raised after the MyButton_Click has finished, when the next event loop begins.