Results 1 to 3 of 3

Thread: How do i catch an application exit.

  1. #1

    Thread Starter
    Hyperactive Member kleptos's Avatar
    Join Date
    Aug 2001
    Location
    The Dark Carnival
    Posts
    346

    How do i catch an application exit.

    I was wondering, how can i catch the event when someone clicks on the little X in the right corner of an application? I need to do some processing and checking right before the application closes i just dont see what to catch to be able to do that.
    ..::[kleptos]::..
    • Database Administrator (MSSQL 2000)
    • Application Developer (C#)
    • Web Developer (ASP.NET)


  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    Use the Closing event of the form
    Code:
    private void YourForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
    {
    	//to cancel closing of the form
    	//e.Cancel = true;	
    }

  3. #3

    Thread Starter
    Hyperactive Member kleptos's Avatar
    Join Date
    Aug 2001
    Location
    The Dark Carnival
    Posts
    346
    I must have not had the form active when i clicked the little lightning bolt in VS.NET, thanks again Serge!
    ..::[kleptos]::..
    • Database Administrator (MSSQL 2000)
    • Application Developer (C#)
    • Web Developer (ASP.NET)


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