Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Preventing to open a form twice or more ...
Message
 
To
31/08/2000 10:56:42
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00411292
Message ID:
00411313
Views:
16
>Any great idea how would i prevent to open a form more than once...

Noel, you may have the code similar to this:

oApp.RunForm(tcFormName)

*** oApp.RunForm method ***
PARAMETER tcFormName
FOR n = 1 to _screen.FormCount
IF _screen.Forms[n].BaseClass == "Form"
IF _screen.Forms[n].cSCXName == tcFormName+".SCX"
IF !_screen.Forms[n].lMultiInstance
ACTIVATE WINDOW (_screen.Forms[n].Name)
ELSE
DO FORM (tcFormName)
ENDIF
ENDIF
ENDIF
NEXT


This code supposes you have .cSCXName property in your base form class and during form initialization you store there the form's SCX name obtained with SYS(1271)
You also may check if multiinstance is allowed for the particular form, storing the proper value in form.lMultiInstance property.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform