Cancellable events

  • Thread starter Thread starter Mr.Tickle
  • Start date Start date
M

Mr.Tickle

I dont like the concept of cancellable events, why cant we have an event
that we can catch before the event we must cancel?

Take the following example

WM_SYSCOMMAND and SC_CLOSE for the system menu close item or close button,
in WinForms you must cancel the Closing event, isnt that too late? Sure it
works but it seems messy compared to actually catching an event that the
item is selected.


Are these a good idea or just lazy or unthought out designing?
 
I think Closing IS the "event before" Close. The event being cancelled is
the Close event.

Given you had a previous event, what other format would you suggest to
specify that you wish to cancel the subsequent chain of events?

Also, suppose in some future OS version new buttons / ways are added to
close a form, or you're working under a different OS. You're code breaks if
you're depending on a specific windows message.
 
so how come win32 has the WM_SYSCOMMAND and WM_COMMAND to indicate a
difference on the close buttons

There either is a difference or there isnt. Here the difference is yes
there is in some parts of the libraries and here there isnt any difference.
Lack of consistency.

There is a difference when it comes to painting yet there isnt when it comes
to closing.
 
We arnt under other OSs, this is reality what we have today, stop bringing
youre fantasies into this.

We are dependant on window messages anyway, WinForms isnt portable. Go look
at mono, its dependant on windows API mapping layers,
 
Back
Top