Hello,
This is the code in my Main Form's init event:
and this in the 'Exit' button's Click event:
When I click the 'Exit' button the first time, the app. does not release the form and return to VFP. It only works on the second click.
I've included 'Clear Events' in 2 places because giving a 'form release' in the Exit button click event didn't work and I was trying various possibilities.
Could someone please advise where I'm going wrong?
Thanks and regards,
Rajesh
This is the code in my Main Form's init event:
Code:
_SCREEN.Visible = .F.
This.Show()
READ EVENTS
CLEAR EVENTS
and this in the 'Exit' button's Click event:
Code:
nResponse=MESSAGEBOX('Do you want to quit this application?',4+32,'Confirm action')
IF nResponse=6
CLEAR EVENTS
ELSE
RETURN
ENDIF
THISFORM.Release
SET CLASSLIB TO
RELEASE ALL EXTENDED
RELEASE MAIN, NCOUNT, LLSPARES, LLSTORES, StoresTreeCreated
RELEASE ApplPath, GLADDMACHINERY, GLADDCOMPONENT, GLADDPART, OCONN, NRESPONSE
CLEAR PROGRAM
CLEAR RESOURCES
RETURN
When I click the 'Exit' button the first time, the app. does not release the form and return to VFP. It only works on the second click.
I've included 'Clear Events' in 2 places because giving a 'form release' in the Exit button click event didn't work and I was trying various possibilities.
Could someone please advise where I'm going wrong?
Thanks and regards,
Rajesh