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 7416457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:30:02+00:00 2026-05-29T07:30:02+00:00

Please accept my apologies,if this question is repeatative. I searched existing questions and solutions

  • 0

Please accept my apologies,if this question is repeatative. I searched existing questions and solutions and I didn’t find exactly solution to my problem.

I’m developing winform application, I have a main form1, which creates form2. Form2 has close button and overidden FormClosing() method to prompt confirmation popup,which works perfectly.

When I want to close form1(which is main application thread) and I want to close all other forms say form2, form3 which were created by form1, without actually prompting confirmation popups for form2, form3. Basically when close form1 it should forcelly close all other forms which were shown from form1, right now it shows all confirmation popups for form2, form3 before exiting application.

I thank for your reply,
regards
skm

  • 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-29T07:30:03+00:00Added an answer on May 29, 2026 at 7:30 am

    You’ll need to pay attention to the e.CloseReason property value that’s passed to you in the FormClosing event. Only prompt the user if e.CloseReason == CloseReason.UserClosing. This also ensures that you don’t display the dialog when the user shuts down Windows. For example:

        private void Form2_FormClosing(object sender, FormClosingEventArgs e) {
            if (e.CloseReason == CloseReason.UserClosing && !saved) {
                switch (MessageBox.Show(this, "Save changes?", "Closing",
                        MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)) {
                    case DialogResult.Yes: Save(); break;
                    case DialogResult.No: break;
                    case DialogResult.Cancel: e.Cancel = true;
                }
            }
        }
    

    Do consider always saving changes so the user won’t suffer from unexpected data loss. Say to a temporary file that you re-open when the program starts back up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to programming, so please accept my apologies if this question is
First off, please accept my apologies if this question is basic, I mainly have
I am very new to Ruby, so please accept my apologies if this question
I am new to perl so please accept my apologies if my question is
I took a look about this problem within the list of question but nothing
Before I start, please accept my apologies that I'm not a mathematician and don't
Im not sure if this is a duplicate, if it is, please accept my
In this question Is there any way to accept only numeric values in a
(Apologies in advance if this question is short on details, I'll watch the comments
Please can someone help sort a noob out? I've posted this problem on various

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.