Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to activate a Form?

Status
Not open for further replies.

sohrab100

Programmer
Jan 18, 2002
56
0
0
HK
The Case:
Modeless form "Form1" (A Timer for show current time on top)
Modal form Form2, Form3, Form4

Form1 is set alwayontop=.t. , desktop=.t., windowtype=0

Sequence:

do form form1
do form form2 --modal call--> form3 --modal call --> form4

In normal case, form4 is the active form, but sometime client report to me system hang on form4 screen and i found out is the form4 lostfocus but so strange that form1 is in active. Therefore, system like hang because of outfocus (mouse click cannot make form4 focus).

What can i do to active the form4 again? Or can i do something that deactivate form1 and the form4 will automatically active?



sohrab100
 
You could add a Thisform.Hide() and even a Form1.hide() in the click event of the button that executes DO FORM Form3, then in the Release event of Form3, add Form2.Show() and Form1.Show(). Do a similar thing for Form4.


-Dave S.-
[cheers]
Even more Fox stuff at:
 
You can activate a form by using:

ACTIVATE FROM frmYourForm

To see if it exists or is on top first, use the WEXIST() and WONTOP() functions.

? WEXIST('frmYourForm')
? WONTOP('frmYourForm')

I hope this is helpful.

Jim Osieczonek
Delta Business Group, LLC
 
Dave S,

Some form can not be hide because of useful information need to show on the back of the form.

Let say, Form1 (Timer/UserInfo show on top corner), if Form1 is hide, the Timer(Clock) and UserInfo will lost.

And Form4(not fullscreen) need to view information at the back form Form3. So, the suggestion is not applicable.

And the main point is how to force Form1 not in focus after form2-4 open, or how can it make form1 outfocus and back to the right form in focus (The Last open Form)


sohrab100
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top