Results 1 to 3 of 3

Thread: Cancel a closing window

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2004
    Posts
    24

    Cancel a closing window

    Anyone knows how to cancel a closing window when a user closes it in the cross button in the caption bar.


    I have an application and i want to get a confirmation before closing it.


    When a user uses the cross button near the maximize and minimize button i want to get a message box with a cancel button to undo this close.


    I tryed the closed event but the window still closes....

    Any suggestions?

    Thanks in advanced

  2. #2
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    In the OnClose(or something like that) event just put
    Code:
    e.Cancel = true;
    sabes quem sou? :P
    \m/\m/

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2004
    Posts
    24
    hehe ty, it works!!


    Acho que sei quem és!!! Mas já n via esse nome à bues!!!
    Tás a dominar c#!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width