Come on everyone - is there anyone there who can help me?

Please!

-------------------------

I have a formset within whcih I launch multiple forms.
I can also launch the same form multiple times.
I have another form that has a timer that does a few things and needs to set
the focus to itself. I want to then reactivate the form that was on top at
the time.

I am currently storing WONTOP() to mWontop at the beginning of the timer
event and then calling ACTIVATE WINDOW (mWontop) at the end of the timer
event.

This seems to work fine except when there are multiple copies of the active
window open. In this case, only the one first opened comes to the top.

I also tried the following but it did nothing:
mWontop = _Screen.ActiveForm
DO Stuff.....
mWontop.Activate

How can I reselect the specific window that was on top at the time?

Cheers
David

Re: How to redisplay the active form when another form gets the focus? by RandyBosma

RandyBosma
Wed May 07 10:20:20 CDT 2008

Hello David,

Forms are not my strong point, but I'll give it a shot:

>I have a formset within whcih I launch multiple forms.

Formsets are not recommended in VFP; that concept was added to the language
only to enable us to convert FPD screen sets.

>I can also launch the same form multiple times.
>I have another form that has a timer that does a few things and needs to set
>the focus to itself. I want to then reactivate the form that was on top at the time.

I see.

>I am currently storing WONTOP() to mWontop at the beginning of the timer
>event and then calling ACTIVATE WINDOW (mWontop) at the end of the timer
>event.
>
>This seems to work fine except when there are multiple copies of the active
>window open. In this case, only the one first opened comes to the top.

Do all the windows have the same name? - If so, is WONTOP() returning the
same value for any or all copies of the form that is open? That might be the
problem here......

>I also tried the following but it did nothing:
>mWontop = _Screen.ActiveForm
>DO Stuff.....
>mWontop.Activate
>
>How can I reselect the specific window that was on top at the time?

In the LostFocus of the form, save some unique value that can be used to pick
the correct window to be re-Activate-ed.

HTH,
Randy

--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums.aspx/foxpro-general/200805/1