Hi Mike

in the QUERYUNLOAD method of your form put the following code:

do goaway in mike


in the main program (MIKE.PRG) write this code

PROCEDURE MIKE
clear
do form mike
read events

ENDPROC

PROCEDURE GOAWAY

if txnlevel() > 0
   ROLLBACK
endif

clear events

set sysmenu to default

ENDPROC

That should do it.

Take care

Rafael Copquin



----- Original Message ----- 
From: "MB Software Solutions,LLC" 
<[email protected]>
To: <[email protected]>
Sent: Thursday, August 13, 2009 3:21 PM
Subject: Releasing a form via the Close button in the top-right corner ofthe 
form


> VFP9SP1
>
> This is one of those silly things I've dealt with over the years but
> forgot apparently.  I've got a modeless form that is called from my main
> program with a READ EVENTS in the main.prg right after the loFrm.Show
> call.  In the form, I've got a button called "Quit" that does a
> thisform.release and that works great, but I want the user to be able to
> just close the form via the "big X" (lol) in the top-right corner of the
> form.  I put a CLEAR EVENTS in the Form's Unload event, but that doesn't
> seem to be the right place for it, because when it never drops to the
> next line in my main.prg after the .Show line.  Ideas?
>
> tia!
>
> -- 
> Mike Babcock, MCP
> MB Software Solutions, LLC
> President, Chief Software Architect
> http://mbsoftwaresolutions.com
> http://fabmate.com
> http://twitter.com/mbabcock16
>
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/e2cdcd9ba70447dba9f7abf4c12e6...@rafaelnueva
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to