Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Prevent opening a form if it's already opened.
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00557131
Message ID:
00557403
Views:
12
Elgin,

You might try to scan the list of forms already running and compare to the name of the current form you are loading...

Copy what you need from the function below I sometimes use...
FUNCTION DOFORM(cformname)
* procedure to start all forms that could be called more than once
* to prevent running multiple copies of the same form
LOCAL x, nform
nform = 0
* scan the forms on the screen
For x = 1 to _screen.formcount
	* formname is case sensitive and will be the name of the form
	If _screen.forms(x).name = (cformname)
		nform = x
	EndIf
Next
If nform > 0
	* just show it
	_screen.forms(nform).show
Else
	* run it
	Do Form (cformname)
EndIf
RETURN .t.
Maybe put the for/next loop in the load of your form class.
Just a suggestion.
Ron Seidl
Independent Developer
VFP

"I'm playing in life's theater in anticipation of a great cast party!"
Previous
Reply
Map
View

Click here to load this message in the networking platform