Marcia's solution was close but did not quite work for me. I have modified it just a bit. None of my modal forms are "always on top" so the proposed solution did not solve my problem. The solution was to add the following code in the "INIT" procedure of the form class:
IF This.WindowType = 1 && Modal
This.AlwaysOnTop = .T.
ENDIF
Then secondly, use Marcia's code in the "DESTROY" event of your form class. This solved the modal form problem 100% and did not add any side effects in my case. Thanks Marcia. I hope this additional information will help somebody else.
>
Unfortunately, and its been happening on a few occasions, control doesn't return to what should be the active batch control form - focus drops to the form behind it (the control centre form the batch form was called from). The background form can be moved around, but nothing executes like button pushes etc, and the foreground form that should have the focus decides to play dead.>
>This code in the form class's Activate that your modal forms are based on - if you are using base classes (and if you are -tsk! tsk! tsk!), this must go in the activate of each form:
>
>
>IF This.WindowType = 1
> This.AlwaysOnTop = .T.
> This.AlwaysOnTop = .F.
>ENDIF
>