Home All Groups Group Topic Archive Search About

[Form].OnClosing - e.Cancel = True???

Author
8 Feb 2006 2:58 PM
Phill W.
Has any come across a situation where, in a Form-derived .. er .. Form,
the Event Arguments passed to OnClosing /already/ have their Cancel
argument set to True?

Protected Overrides Sub OnClosing( _
  ByVal e As System.ComponentModel.CancelEventArgs _
)
    Debug.WriteLine("e.Cancel=(" & e.Cancel.ToString() & ")")
    ' It's True already !!

    MyBase.OnClosing(e)
.. . .

This is making closing my form just a /little/ difficult!

Any suggestions where to start looking?

TIA,
    Phill  W.

ps. I'm using VB 2003 (v7.1.3088) on Windows XP, SP2.

Author
9 Feb 2006 10:43 AM
Peter Proost
It could have to do with validating events on controles who have
causesvalidation set to true. I had the same problem once, and with me that
was the cause. Do a search on this group via google and search for: e.cancel
causesvalidation

Hope this helps

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

Show quoteHide quote
"Phill W." <p-.a-.w-a-r-d@o-p-e-n.a-c.u-k> schreef in bericht
news:dsd0t8$pbh$1@yarrow.open.ac.uk...
> Has any come across a situation where, in a Form-derived .. er .. Form,
> the Event Arguments passed to OnClosing /already/ have their Cancel
> argument set to True?
>
> Protected Overrides Sub OnClosing( _
>   ByVal e As System.ComponentModel.CancelEventArgs _
> )
>     Debug.WriteLine("e.Cancel=(" & e.Cancel.ToString() & ")")
>     ' It's True already !!
>
>     MyBase.OnClosing(e)
> . . .
>
> This is making closing my form just a /little/ difficult!
>
> Any suggestions where to start looking?
>
> TIA,
>     Phill  W.
>
> ps. I'm using VB 2003 (v7.1.3088) on Windows XP, SP2.
>
>