Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you insure you run only one instance of a form?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00256254
Message ID:
00256274
Views:
22
Jeff,

Assuming each form has a unique .Name property, use this UDF in a SKIP FOR condition on the each form menu item:

FormRunning( "frmOne" )

Here's the UDF:
* FormRunning.PRG 08-Mar-98

* determine if a particular form is running. 

* It checks the Name property

lparameter pcFormName

local i, llRetVal

llRetVal = .f.
pcFormName = upper( pcFormName )

for i = 1 to _screen.FormCount
   if ( upper( _screen.Forms[i].Name ) == pcFormName )
      llRetVal = .t.
      exit
   endif
endfor

return llRetVal
>Application:
>Multiple forms run within a top level form. Each form is invoked by a menu which runs within the top level form. Config.fpw has application.visible = .F.
>
>Question:
>How can I insure that only one instance of each form can be invoked. I do want the user to be able to be using a second form at the same time.
>
>Alternatives thought about:
>Grey out the menu selection after it is selected, reactivate after the form is closed.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform