Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to detect if a form is already open?
Message
 
 
To
04/12/2005 12:45:53
John Faithfull
Hunterian Museum, University of Glasgow,
Glasgow, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Novell 5.x
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01074732
Message ID:
01074783
Views:
18
My Solution,

1-give form name to the form with the same scx name for form

2-cerate property on the form named IsUnique with default value .T.

3-put below codes to the form load method
Local x,nFormCount
nFormCount=0
If This.IsUnique
	For x=1 To _Screen.FormCount
		If _Screen.Forms(x).Name==This.Name
			nFormCount=nFormCount+1
		Endif
		If nFormCount>1
			_Screen.Forms(x).Show() 
			Return .F.
		Endif
	Next
Endif
HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform