MsgBox steals focus (bug?)

Writing a little app that requires that two fields be filled out to continue. On initialization of the form the focus method of the first text box is called and operates properly. After clicking a button, the code checks to see if both fields are filled out. Finds that they’re not so it issues a MsgBox dialog indicating the error.

On dismissal of the MsgBox a call is made to [textbox].focus(). It appears to get focus while the MsgBox is displayed but loses focus when the MsgBox is dismissed. This suggests that MsgBox is not modal, the execution of the focus() method seems to have taken place asynchronously. Can MsgBox be made modal so execution of the thread will stop while the MsgBox is being dealt with?




The MsgBox operation is correct - it is not modal. (See the docs)

The statement has a callback option - could you use that to accomplish what you need?

Which statement has a callback option, MsgBox?

I’ll check. This is the documentation from the language reference. No mention of a callback.

Yes, MsgBox.