Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Vicos Vicos
  Where is Vicos Vicos?
 Oltenita
 Romania
 Vicos Vicos
 To: Chester Costa
  Where is Chester Costa?
 Metro Manila
 Philippines
 Chester Costa
 Tags
Subject: RE: limit a form
Thread ID: 364919 Message ID: 365237 # Views: 29 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: General VFP Topics
Date: Saturday, December 22, 2012 5:17:35 PM         
   


> is there a way to limit a form from opening a multiple form.like opening a login form which can only be open once??

In Load() method

Local lnInstanceRequired,lnCounter,loForm
lnInstanceRequired = 1
lnCounter = 0
For Each loForm In _Screen.Forms
	If loForm.Name == This.Name
		lnCounter = lnCounter + 1
	EndIf
EndFor
If lnCounter > lnInstanceRequired
	=MessageBox("Already open",0+16,"Stop")
	Return .F.
EndIf



Vilciu Constantin
http://expertsoft.eu

ENTIRE THREAD

limit a form Posted by Jem Carlo Mallari @ 12/20/2012 9:55:30 AM
RE: limit a form Posted by Tore Bleken @ 12/20/2012 10:07:34 AM
RE: limit a form Posted by mk sharma @ 12/20/2012 10:13:33 AM
RE: limit a form Posted by Jem Carlo Mallari @ 12/20/2012 10:42:25 AM
RE: limit a form Posted by Tore Bleken @ 12/20/2012 10:51:32 AM
RE: limit a form Posted by Jem Carlo Mallari @ 12/20/2012 10:58:31 AM
RE: limit a form Posted by mk sharma @ 12/20/2012 11:24:01 AM
RE: limit a form Posted by Jem Carlo Mallari @ 12/21/2012 1:31:54 AM
RE: limit a form Posted by Jun Tangunan @ 12/21/2012 1:50:23 AM
RE: limit a form Posted by David Mustakim @ 12/20/2012 3:20:46 PM
RE: limit a form Posted by Victor Espina @ 12/20/2012 9:30:29 PM
RE: limit a form Posted by Rick Hodgin @ 12/20/2012 8:38:14 PM
RE: limit a form Posted by David Mustakim @ 12/21/2012 7:42:45 PM
RE: limit a form Posted by Vicos Vicos @ 12/22/2012 5:17:35 PM