>I am having a small problem with a new "wait window"-type form I've created for my app.
>
>I need to call this form ("WaitWind") and pass it some text, which it displays in the middle of the screen. So far, so good.
>Then I need to return the focus back to the object that called the WaitWind form.
>Once control has returned, and keypress or mouseclick anywhere needs to close that WaitWind form off. This is where I am stuck.
>
>Any suggestions?
Create an invisible wait window in the Activate Method of your WaitWind form. As soon as the wait window is cleared, release WaitWind. I'm guessing you want to make WaitWind generic so it can be called from any form in your app, so you'll need to add three bits of code.
First, add code to DO FROM WaitWind to pass a reference to the object you wish to have focus after WaitWind clears
DO FORM WaitWind.scx WITH This
- or -
DO FORM WaitWind .scx WITH Thisform.Text1
Second add code to the init of WaitWind to store the calling object reference in a property
Parameter oForm
ThisForm.AddProperty("oCallingObj",oForm)
Finally add the code to the Activate of WaitWind that does the work.
ThisForm.oCallingObj.setfocus
wait window ""
thisform.release()
David.