Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Closing a form opened with DO Form
Message
From
12/09/2002 16:38:25
 
 
To
12/09/2002 16:17:37
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00699878
Message ID:
00699941
Views:
21
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform