Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6749803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:44:01+00:00 2026-05-26T12:44:01+00:00

I have searched through stackoverflow and has found similar question. As I am still

  • 0

I have searched through stackoverflow and has found similar question.

As I am still a beginner in C# programming, I could not quite understand what the solutions meant.

I have a c# windows form application that has several forms.

As it only closes when I closes the main form, how do I code it such that when I close other form the application closes as well?

EDIT: most people has told me to code it in the closing event. may i know where is the event found at? thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:44:01+00:00Added an answer on May 26, 2026 at 12:44 pm

    Not sure why you think out answers will be any easier than ones you have found already but..

    A Form has an event called “Closing” (See Here). You should handle the event and then inside that function you can use the following line to close your application…

    System.Windows.Forms.Application.Exit();
    

    NOTE: This is for a WinForms application

    EDIT:

    You can register the closing event using VS designer mode like this…

    1. Select the form
    2. Go To the “Events” window
    3. Double click the “Closing” event option

    More detailed answer here

    (Google if you cannot work this out)

    or you can register the event in code like this…

    //In Form constructor function
    this.Closing += new EventHandler(Form1_Closing);
    
    private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
    {
       //Handle event here
       System.Windows.Forms.Application.Exit();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched quite extensively throught stackoverflow but unfortunately found no conclusive answer to
I've searched through stackoverflow and google's extension FAQ but could not seem to find
I have searched through many times but have not seen this before. Probably really
I have searched through internet & found that there are no any direct method
I am not very familiar with .htaccess and have already searched through the net
I have a difficult problem. Difficult means I searched through the net and StackOverflow
I've searched and searched stackoverflow and www, but have found no answers to this
I have searched the internet for an answer to what could be causing EXCEPTION_ACCESS_VIOLATION
I have searched through the google and also joomla forums but didn't got what
I'm rather new to ClearCase but have searched through a lot of solutions to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.