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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:29:14+00:00 2026-06-05T02:29:14+00:00

I am trying to detect that form2 is closed in form1. I have this

  • 0

I am trying to detect that form2 is closed in form1. I have this so far

    private void AddStageBtn_Click(object sender, EventArgs e)
    {
        Form2 form2 = new Form2();
        form2.ShowDialog();
        if (form2.IsDisposed)
        {
            MessageBox.Show("it was closed!");
        }
    }

Any suggestions? Thanks again!

  • 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-06-05T02:29:15+00:00Added an answer on June 5, 2026 at 2:29 am

    Adhere to the FormClosed event of form2.

    Wherever you create it do:

    form2.FormClosed += new FormClosedEventHandler(form2_FormClosed);
    

    Then create the method:

    void form2_FormClosed(object sender, FormClosedEventArgs e)
    {
        // Do whatever you want here
    }
    

    You’ll also want to use .Show() instead of .ShowDialog() if you want to be able to use either form, otherwise form1 will be unavailable until form2 is closed (which I am assuming is not the behavior you are looking for).

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

Sidebar

Related Questions

I am trying to detetct/work around this bug in RSS elements. That means I
Trying to detect left click vs right click (without using jQuery!) and I have
I have a form that is showing a MessageBox using MessageBox.Show, and trying to
I seem to have a problem I am trying to detect when my form
In Delphi XE, I'm trying to use GetForegroundWindow to detect the window that was
I have a from that has a text box and I'm trying to determine
I have a textbox on a form where I'm trying to detect the keys
I have some search results that I'm outputting that are of this form: <div
I am trying to simply detect that current method has which parameters so i
I have been trying to solve this problem for several weeks now and it

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.