Re: Get the "User pressed close button (in controlbox)" event...
From: msnews.microsoft.com (freddyk_at_microsoft.com)
Date: 04/09/04
- Next message: Lindsay Miles: "Undo/Redo mechanism"
- Previous message: Mystique: "OpenFileDialog"
- In reply to: Klaus: "Get the "User pressed close button (in controlbox)" event..."
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 9 Apr 2004 15:44:58 +0200
Good practice would be to make code that does not need to know this.
Reason: If for some reason the next version of something makes a new way of
closing a window - you would have to change your code accordingly.
You should make the code to flag a success-return whereever this is needed
and you should take anything else as a cancel.
So - your dialog probably will have a static execute method, which creates
the dialog - runs it modal and returns the result - you should set the
result value to cancel in your constructor - and change it whereever you
select to return something else.
If you are in a situation where you have to know - you should override
WndProc and make special code for the message that origines from the X
button.
/Freddy
"Klaus" <klaus@-NOSPAM-kitchen-net.com.au> wrote in message
news:uESutsdHEHA.2668@TK2MSFTNGP10.phx.gbl...
> ..a seemingly easy task, but I just can't figure it out:
>
> want to retrieve the event "close ("X") button clicked" in a modal form.
Can't use the "Closing" event as I have to distinguish between a closing of
the form after a selection made and an abortion (which happens when the user
just closes the modal form by the forms Close ("X") button.
>
> Anyone an idea?
>
> Thanks.
> Klaus
>
> ---
> Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
- Next message: Lindsay Miles: "Undo/Redo mechanism"
- Previous message: Mystique: "OpenFileDialog"
- In reply to: Klaus: "Get the "User pressed close button (in controlbox)" event..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|