Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Close buttins

Status
Not open for further replies.

FRED123456789

Technical User
Jun 2, 2004
8
GB
Hi

Wonder if any one can help

Is there any way of changing the way or stopping windows closing Paradox 8 when an operator clicks on the X (close in the top right of the screen?)

We have Temps using our data base and they try to use the close button instead of the paradox buttons that write the data collected in a form to a table.

Thanks for looking at this problem and happy Christmas.

 
In each FORM's menuaction:

method menuAction(var eventInfo MenuEvent)

if eventInfo.isPreFilter() then
;// This code executes for each object on the form

else
;// This code executes only for the form
switch
case eventInfo.id() = MenuControlClose:
msgstop("Exit Error","Use the 'Close' button to exit!")
eventInfo.setErrorCode(UserError)
endswitch

endIf

endMethod

You must, then, allow the app to exit in some manner.

With mine, I have a startup script waiting() on the form, and IT exits when the form does a formreturn().

Tony McGuire
 
To allow exit, you might also want to create a flag; something like loCanClose

At the FORM's var
var
loCanClose logical
endvar

At form open, set
loCanClose=False


In the menuaction,

switch
case eventInfo.id() = MenuControlClose:
if not loCanClose then
msgstop("Exit Error","Use the 'Close' button to exit!")
eventInfo.setErrorCode(UserError)
else
close()
endif
endswitch

In the button you wish to use to ALLOW the form to close Paradox, set

loCanClose=True

Tony McGuire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top