Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Forms not releasing?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00428033
Message ID:
00428042
Vues:
21
Hi Steve,

In your command button you call the other forms.
Before that you release the form.
But the code in the command button waits until you are ready using the next form.
Before that the form will not release cause the code in that form is still running.

A workaround for this can be the following.
Create a timer class.
Add a property to it named cCommand
set interval to 10
set enabled to .f.
In the timer event place the following
Local lcCommand
this.enabled = .f.
lcCommand = this.cCommand
&lcCommand


At runtime create a instance of this class bound to your application object or something.

Now in your button to go to another form do the following.
first of all do release thisform
then say oApp.MyTimer.cCommand = 'Do Form Form2 with .....'
then set oApp.MyTimer.enabled = .t.

Then i think it will work.

Greetings,

Ko Wisse



>My forms are not releasing until I press the Exit button and then I see them all flash before my eyes in rapid sequence before they all finally release/disappear. What's going on here? It acts like the forms are not releasing until I press the Exit button.
>
>I have several forms that are all modal. My .PRG starts the first form which has button across the bottom of it that allow me to choose from several data entry forms. All forms are the same size and have either textboxes, comboboxes, checkboxes or editboxes and command buttons on them. All forms have ControlBox property = .F., AutoCenter = .T. All forms have the same property settings except for the Name.
>
>Here is my command button code to switch from form to form:
>
>THISFORM.Release
>DO FORM \ARREST\FORMS\MED.SCX WITH ;
>	cForm, cIncident, cAddSW, cEditSW, cMainFrmSW, ;
>	cMedFrmSW, cShkFrmSW, cTimFrmSW, cAEDFrmSW, cOutFrmSW, cAdmFrmSW, cAdmSW
>
>
>Here is my Exit button code:
>
>SELECT master
>IF gcAddSW = 1 OR gcEditSW = 1 && Add or Edit mode
>	REPLACE master.rec_mode WITH 2
>ENDIF
>IF gcBrowseSW = 1 && Browse mode
>	REPLACE master.rec_mode WITH 0
>ENDIF
>= TABLEUPDATE(.T.,.T.,'master') && Save Master database changes
>UNLOCK
>
>THISFORM.saverec2
>SELECT master
>mast_rec=recno()
>THISFORM.Release
>
>
>Here is my .PRG code:
>
>**********************************************************
>* Main Program for SCA.EXE
>*
>* Copyright 1999. EMSG, Inc.
>*
>**********************************************************
>* Run the main form and establish the event loop
>SET EXCLUSIVE OFF
>SET SYSMENU OFF
>SET TALK OFF
>SET STATUS OFF
>SET STATUS BAR OFF
>SET CURSOR ON
>SET MEMOWIDTH TO 80
>PUBLIC VARIABLE mast_cap && Forms title bar for Incident #, Patient Name, and Age
>mast_cap = ""
>
>DO FORM \arrest\forms\main.scx
>SET ALTERNATE OFF
>SET ALTERNATE TO
>SET PRINT OFF
>SET CONSOLE ON
>CLOSE ALL
>RELEASE ALL
>DEACTIVATE WINDOWS ALL
>
>
>Thanks for helping me figure this strange problem out.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform