Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to close the form, using _screen.activeform
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01009903
Message ID:
01009906
Vues:
8
Try
FOR i=_Screen.FormCount TO 1 STEP 1
	IF _Screen.ActiveForm.Name <> "Main"
		_Screen.ActiveForm.Release()
	ENDIF
ENDFOR
>I am a software programmer in a company making accounting and inventory softwares.
>I have to make a logout option in my software, when ever the user click on logout in the menu, all the form should close and the user login form should re-run.
>
>I have partly solved this problem, but i am sort of stuck in the middle.
>In my software there is one main form, which has the property of Alwaysonbottom as .T.
>which has the name= "Main"
>
>so i have written one simple routine to close the remainning forms
>
>do while .t.
> xFrmName = _screen.activeform
> if xFrmName = "Main"
> exit
> endif
> xFrmName.release
>enddo
>
>the above code is running absolutely fine, but it crashes in one condition,that is if any of the forms which are open have the focus on the grid, then it does not releases the form, as a result it goes in the indefinite loop.
>i tried using release form, clear windows etc. but it did not work either
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform