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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:55:40+00:00 2026-05-26T05:55:40+00:00

I have a test app with multiple forms, one being a crude kind of

  • 0

I have a test app with multiple forms, one being a crude kind of menu. When I select one of the other forms with a button click the menu form minimises. All good.

What I want to happen now is when I have finished with the second form and click the red cross I want the menu to open back up from the tray. Seems simple but Im pulling my hair out.

private void Form2_Closing(object sender,System.ComponentModel.CancelEventArgs e)
{
    var menu = FormControl.MainMenu;
    menu.WindowState = FormWindowState.Normal;

    e.Cancel = false;
}

FormControl is my class to ensure only one instance of MainMenu can be opened. The code works inside the button click event but I am unable to get any kind of form closed/closing event to trigger.

  • 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-26T05:55:41+00:00Added an answer on May 26, 2026 at 5:55 am

    ok, your comment about “Windowstate may not work in that particular event” disturbed me so I made simple test:

    1. Created Form1 and Form2
    2. Added button and click event to Form1
    3. Added FormClosed event to Form2

    Button1 Click event handler:

    private void button1_Click(object sender, EventArgs e)
    {
        Form2 form2 = new Form2();
        form2.WindowState = FormWindowState.Normal;
        WindowState = FormWindowState.Minimized;
        form2.Show(this);//Passing Form1 as owner
        form2.Activate();
    }
    

    Form2 FormClosed event handler:

    private void Form2_FormClosed(object sender, FormClosedEventArgs e)
    {
        this.Owner.WindowState = FormWindowState.Normal;//change state of owner form
    }
    

    Result:
    After program launches – opens Form1. After clicking button – Form1 minimizes and Form2 pops up. After closing Form2 – Form1 restores to normal state.

    Resume:
    double check if your Form2 REALY suscribed to FormClosed or FormClosing event.

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

Sidebar

Related Questions

We have multiple config files (app.DEV.config, app.TEST.config, etc) and a pre-build event that copies
Within my php app I have multiple templates that get combined to form a
I am trying to create a multiple choice test app. I have this code
I have a RoR3 app with multiple environment configs, development.rb, test.rb and production.rb. Is
I have an iphone app, with a view (well multiple but let's say one
I have an app with which i can select from multiple MSI's (same msi,
How do you manage multiple configurations for Azure cache. We have one test and
I have small test app: Socket socket = new Socket(jeck.ru, 80); PrintWriter pw =
I have a test winforms app with ThreadExceptionHandler that displays a message box when
I have a WPF test app for evaluating event-based serial port communication (vs. polling

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.