Modal forms in hidden screens

When you call the Show() method of a form passing 1 as a parameter, you expect the form to show modally. There are some cases, when this is not the case, though. For instance, when the form is already visible, you receive a "Cannot change modality of a visible form" error message. Or, if the form is top-level form it cannot be modal.

Public oForm
oForm = CreateObject("Form")
_Screen.Visible = .F.
oForm.Show(1)
MessageBox("Done")
_Screen.Visible = .T.