Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Closing a form opened with DO Form
Message
De
12/09/2002 16:38:25
 
 
À
12/09/2002 16:17:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00699878
Message ID:
00699941
Vues:
20
>Hi Ed,
>My form is modeless. What I was hoping for was a way to close it without clicking on the X or by using CTRL+F4. Is there a way to close the form with a button?

Sure - if the button is one the form, have the button execute thisform.release() in it's Click event. If it's on a different form, save a reference to the form (create a reference to the new form in a memvar using the NAME clause of DO FORM, and save that to a property of the form that owns the close button:
DO FORM <i>Blah</i> NAME oWoof
thisform.oBlahRef = oWoof
oWoof = NULL
In the close button on the parent form, reference the child form through the saved property to trigger its release:
IF TYPE('thisform.oBlahRef') = 'O' AND ! ISNULL(thisform.oBlahRef)
   =thisform.oBlahRef.Release()
   thisform.oBlahRef = NULL
ENDIF
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform