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!

Exiting the Program using the X Button from Menu 1

Status
Not open for further replies.

trevr1

Programmer
Feb 4, 2003
23
US
Hello,

I would like to have the user be able to close my program by clicking on the very top right X of the program.

Right now it is not activated and therefore you can't click on it. I built a menu with the menu designer and can't figure out the control to make the X clickable.

I've tried:
THISFORM.ControlBox = .T.
ThisForm.TitleBar = 1
on a form, but this allows you to exit the form not the menu from above.

Any ideas? Thanks for your help.
 
Thanks Ramani for the quick response.

I placed this code in my starter program and the minimize, max, and close (X) disappeared. So I changed the code to:

_screen.controlbox = .t.
_screen.closable = .t.

Now I can see the X. But when I click it, it states it cannot close Visual Fox Pro. Any ideas on how you can get around this. I'm almost home. Thanks for your help.

 
Try this in the startup of your program.

on shutdown do quitit

Make this a .prg file.

*******************
PROCEDURE quitit
*******************
ans = messagebox('Exit this program ?',4,'Quit Program Now?')
if ans = 6
on shutdown
clear events
ENDIF
RETURN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top