Jump to content
Sign in to follow this  
rvictor

Cancel vs. Close Question

Recommended Posts

Perhaps this should be obvious, but unfortunately it isn't. I've got the following lines of code and would like to differentiate between the user pressing the Cancel button vs. clicking on the Close "X" in the upper right corner. Is this possible?

$Folder = FileSelectFolder($Task, '', 2, $LastFolder) ;Open folder select dialog

If @error Then

Exit

I like to do something like

if cancel then main menu

if close then end program

Thanks,

Dick

Share this post


Link to post
Share on other sites

Within this context of the FileSelectFolder() dialog, to close the dialog is equivalent to clicking the "Cancel" button, no folder was selected and the only thing that happened is that somebody decided not to select a folder. It would be bad practise to go against this convention. You should adopt a new strategy to handle your task. :)

Share this post


Link to post
Share on other sites

Within this context of the FileSelectFolder() dialog, to close the dialog is equivalent to clicking the "Cancel" button, no folder was selected and the only thing that happened is that somebody decided not to select a folder. It would be bad practise to go against this convention. You should adopt a new strategy to handle your task. <_<

OK, thanks. I can send them back to the main menu from which they can exit the program, but it had seemed to me that in most cases one would expect to exit the program by clicking the X in the upper right and I was trying to respect that expectation. In rethinking that assumption and looking at the operation of some commercial software, it appears that I was incorrect.

Thanks for the clarification and for causing me to think further than I had.

Dick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...