Tracy,
Thank you, this works very well.
Thanks,
Jerry
>This is what I do to bring a specific form to the top of the stack:
>
>
>*--In this example, the form name is ADDFIELDS and is always opened using
>*--oADDFIELDS as an object name. I want to bring it to the forefront if
>*--it is already instantiated and if not, instantiate it.
>llfound = .F.
>FOR EACH loForm IN _VFP.FORMS
> IF VARTYPE(loForm) = "O" AND pemstatus(loForm, "BaseClass", 5) AND loForm.BASECLASS = "Form"
> IF UPPER(loForm.NAME) = 'ADDFIELDS'
> llfound = .T.
> IF loForm.WindowState=1
> loForm.LockScreen = .T.
> loForm.WindowState = 0
> loForm.LockScreen = .F.
> ENDIF
> loForm.refresh()
> loForm.Show(loForm.WindowType)
> ENDIF
> ENDIF
>ENDFOR
>IF !llfound
> IF TYPE('oAddFields')="U"
> PUBLIC oAddFields
> ENDIF
> DO FORM addfields NAME oADDFIELDS LINKED
>ENDIF
>
>
>>I am using VFP8.
>>
>>I am trying to get the SHOW WINDOW command to work with a form. In my app, if a form is opened, in a particular situation, I want to bring that form to the front. I am trying the following but nothing is happening.
>> "SHOW WINDOW MyFormName TOP"
>>
>>For example, Form1 and Form2 are running, a user hits a button on Form2 and Form1 should come to the front. But my "SHOW WINDOW MyFormName TOP" command does not bring the desired form to the front. Nothing happens, no error.
>>
>>But if I place an invalid form name in the command I do get an "Window 'x' has not been defined". "SHOW WINDOW FormThatDoesntExist TOP"
>>
>>What else can I try to get this to work?
>>
>>Thanks,
>>
>>Jerry