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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I test the existence of a form

Status
Not open for further replies.

castor2003

Programmer
Jul 5, 2003
115
LC
I have a few forms working together. They don't have caption. I have poked my brains the best I know to find a way to determine if they are visible so I could take certain steps. I know it is a simple issue that is just eluding me.. I tried using PEMSTATUS AND GETPEM, but these left me more confused. Can anyone share some light?.
 
Castor,

If you want to know if a given form is actually running, you could do this:

llFormIsRunning = .F.
FOR EACH loForm in _SCREEN.Forms
IF loForm.Name = "MyForm"
llFormiIsRunning = .T.
EXIT
ENDIF
ENDFOR

Similarly, if you want to test the visibility of a form, use the same code, but add a test for loForm.Visible.

Hope this helps.

Mike


Mike Lewis
Edinburgh, Scotland
 
I really don't believe myself. You know I used that very same method to cascade some forms in this very app that I am working on. I think it was a case of WRITERS BLOCK.

THANKS ALOT.
 
I believe the old WEXIST() function still works too.

IF WEXIST('myWindow')
ACTIVATE WINDOW myWindow
ELSE
DO FORM myWindow
ENDIF





Jim Osieczonek
Delta Business Group, LLC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top