CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
+ Reply to Thread
Results 1 to 5 of 5
  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
    Join Date
    Jul 2008
    Location
    WV
    Posts
    4,477

    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
    10,793

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

    Mark your thread resolved please

+ Reply to Thread

Bookmarks

Posting Permissions

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



HTML5 Development Center

Click Here to Expand Forum to Full Width