CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2000
    Location
    CA, USA
    Posts
    305

    How to prevent a window from closing?

    Hi,
    How do I prevent a window from closing. I
    handled the windowClosing event where I display
    a confirmation message to the user. If he/she
    clicks no, the window should remain active.
    I don't call system.exit(0) when the user
    clicks no but the window closes still.

    Please reply.

    Kannan



  2. #2
    Join Date
    Dec 1999
    Location
    Chonghe, Taipei County, Taiwan, R.O.C.
    Posts
    231

    Re: How to prevent a window from closing?

    I guess that you might dispose the resource of your Window object.
    Frame.dispose() ?
    If it is the point, you may consider to remove it from your code.
    good luck
    Alfred Wu


  3. #3
    Join Date
    Jan 2000
    Location
    CA, USA
    Posts
    305

    Re: How to prevent a window from closing?

    Sorry, I tried that already. It didn't work.

    Any other suggestions ?

    Kannan




  4. #4
    Join Date
    Sep 1999
    Location
    Madurai , TamilNadu , INDIA
    Posts
    1,024

    Re: How to prevent a window from closing?


    If your frame is JFrame , set "setDefaultCloseOperation(int operation)" to "DO_NOTHING_ON_CLOSE"


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

Featured