Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Having a form close itself
Message
From
08/06/2001 07:04:26
David Fluker
NGIT - Centers For Disease Control
Decatur, Georgia, United States
 
 
To
07/06/2001 16:44:55
Wayne Thomas
Cleansuite Software Inc
Calgary, Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00516650
Message ID:
00516800
Views:
8
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform