Re: Putting in a 'Do you really want to quit' routine
- From: "MikeD" <nobody@xxxxxxxxxxx>
- Date: Tue, 10 May 2005 18:34:23 -0400
"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
.
- References:
- Putting in a 'Do you really want to quit' routine
- From: Macsicarr
- Putting in a 'Do you really want to quit' routine
- Prev by Date: Re: Restart a Service
- Next by Date: Re: VB6 app license protection
- Previous by thread: Re: Putting in a 'Do you really want to quit' routine
- Next by thread: VB6 and Web Folders
- Index(es):
Relevant Pages
|