Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Prevent form to load again ?
Message
 
 
À
27/07/2000 07:17:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00397486
Message ID:
00397504
Vues:
10
I have an application class where I have a DOFORM method. Whenever I want to run a form, I issue the command oApp.DoForm('SCXName_of_the_Form', 'Name_of_the_Form')

In the method, I loop throught the _screen.forms() collection looking for the form name as defined in the form's NAME property. If I find it, I show that form. Otherwise I start a new instance. If I do not pass the second parameter (form name), my method opens a new instance of the form regardless of how many already exist. Sample code:
lparameters tcForm, tcFormName
if type("tcForm") <> "C"
   return .f.
endif
tcForm = alltrim(tcForm)
if empty(tcForm)
   return .f.
endif
if type("tcFormName") = "C"
   tcFormName = alltrim(upper(tcFormName))
else
   tcFormName = ""
endif
local llFound, i
llFound = .f.
i = 0
if !empty(tcFormName)
   for i = 1 to _screen.formcount
      if upper(_screen.forms(i).name) = tcFormName
         llFound = .t.
         exit
      endif
   endfor
endif
if llFound
   _screen.forms(i).Show()
else
   do form (tcForm)
endif
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform