Detecting when the close (X) button has been pressed
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Detecting when the close (X) button has been pressed

  1. #1
    Join Date
    Mar 2011
    Posts
    4

    Detecting when the close (X) button has been pressed

    I have a form that has a done or ok button but I want to know when / if the user clicks the X button at the top rather than the done button. Is there some sort of boolean that is set to true or something like that?

  2. #2
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    4,853

    Re: Detecting when the close (X) button has been pressed

    You could easily place a boolean toggle under your ok/done button and then check it in the form closing event
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Mar 2011
    Posts
    4

    Re: Detecting when the close (X) button has been pressed

    Ok, I figured it out. Thanks anyways!

  4. #4
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Detecting when the close (X) button has been pressed

    Override OnClosing().

  5. #5
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,098

    Re: Detecting when the close (X) button has been pressed

    Mark your thread resolved please

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center