Re: Putting in a 'Do you really want to quit' routine

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Macsicarr" <nospam@xxxxxxxxxx> wrote in message
news:u3dc2JZVFHA.1508@xxxxxxxxxxxxxxxxxxxxxxx
> Hi All
>
> I have a standard form that has the 'x' top right-hand corner and also has
> a
> File/Quit (thanks to the Menu Editor).
>
> What I'm trying to do is put a msgbox up after the user goes to File/Quit
> or
> clicks the 'X' to say 'do you really want to quit Yes/No'. If they click
> yes, then the program ends. If they click no, then the program stays
> where
> it is.
>

Ken and others (since you apparently multiposted this) have answered your
question.

Basically, any prompts you need to make to the user should be done in the
Query_Unload event. This is the ONLY event they really should be in. You're
Quit menu should do nothing more than unload the form (which will cause the
Query_Unload event to fire). IOW, you don't need to duplicate any code.

But keep this in mind.....

Most users are going to be annoyed at having to answer a "do you really want
to quit" prompt. There are programs where such a prompt is warranted...for
example, an anti-virus or firewall program (IOW, something that provides
protection). For most other programs, you should NEVER prompt the user if
they want to quit. This is NOT to say you should not prompt the user to save
data if data has changed since the last time it was saved. But don't annoy
users by asking them if they want to quit your program if there's no
consequence to quitting. Too many programs do this already. Don't make
things worse.

--
Mike
Microsoft MVP Visual Basic


.



Relevant Pages

  • Re: normal.dot
    ... after I cleanup all normal.dot and save the one word built ... but if I quit the prompt still comeup. ... >> normal template" on tool,options,save tab in word. ...
    (microsoft.public.word.docmanagement)
  • Re: fgets behaviour with strncmp
    ... prompt> <- \n ... prompt> quit <- should quit as per my snippet, ... really learnt the ANSI way ala fgets, fopen, etc.. ... int main ...
    (comp.lang.c)
  • Putting in a Do you really want to quit routine
    ... File/Quit. ... Should I not be putting this check/quit code in the form_unload routine? ... I want it to be an option to quit the program. ... End command so that you free up finished resources or does the End command ...
    (microsoft.public.vb.enterprise)
  • Putting in a Do you really want to quit routine
    ... File/Quit. ... Should I not be putting this check/quit code in the form_unload routine? ... I want it to be an option to quit the program. ... End command so that you free up finished resources or does the End command ...
    (microsoft.public.vb.general.discussion)
  • Re: fgets behaviour with strncmp
    ... basic CLI functionality as per: ... prompt> <- \n ... prompt> quit <- should quit as per my snippet, ... int main ...
    (comp.lang.c)