View Full Version : Creating a close button
scargin
08-26-2003, 06:38 PM
I have created a close button on the top of my application and would like a window to appear that will give users the choice to either close the application or cancel the close request.
I have placed the following actions on the button:
%Result% = Dialog.MessageBox ("Close", "Do you want to close CPA into ...", Yes|No, Question)
Application.Exit
Unfortunately if you click "No" the application exits anyway.
What do I need to add to the actions to get "no" to just close the dialog box?
Thanks,
Stuart Cargin
Corey
08-26-2003, 07:04 PM
You need to enclose the Application.exit action inside a CONDITIONAL > IF statement which tests the variable %Result% to see whether it contains the value "yes" or the value "no". So that way your application.exit action will only apply itself if the %result% variable contains the correct value, i.e. "yes".
Check out the help files for help on creating and using an IF statement, real easy stuff, you can learn it in a few minutes... Think of IF statements as gateways which only allow items you specify to pass through.
Also I just emailed you a .zip file with a working example you can check out, I sent it to your registration email address.
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
scargin
08-27-2003, 01:42 AM
Thanks Corey.
Although I found the help file a little hard to follow, the file you e-mailed showed me where I went wrong.
Thanks again,
Stuart Cargin
Corey
08-27-2003, 01:44 AM
No probs, glad you got it.
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
imagesbyken
08-28-2003, 01:37 PM
Could I possibly get a copy of that file also?
Corey
08-28-2003, 07:37 PM
Just sent it to your hotmail address Ken...
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
imagesbyken
08-29-2003, 09:40 AM
Thanks. I have done some VB so this was not totally new to me. Doing it in AMS just looked different. I figured it out before you sent the email, I am going to compare it to what you sent to me. Once again, Thanks
Corey
08-29-2003, 02:42 PM
Cheers.
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.