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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:47:00+00:00 2026-06-05T12:47:00+00:00

What i want to do: ->Open a MDI form ->Close the projects main form

  • 0

What i want to do:
->Open a MDI form
->Close the projects main form
->Without closing the application

What i have done:

frmMain fm = new frmMain();
fm.Show();
this.Close()

Any help would be appreciated! 🙂

  • 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-05T12:47:01+00:00Added an answer on June 5, 2026 at 12:47 pm

    If you actually wish to close the main form, but leave the application running, you can make your default class launch the application context:

    using(MyContext myContext = new MyContext())
    {
        Applicaton.Run(myContext);
    }
    

    where MyContext inherits from ApplicatonContext.

    Your application context can then load and close forms as needed. I do this with one project where I have the context launch a login form. Only after it is completed successfully does the main form get loaded. I also allow the “logging out” from the program to be handled by terminating the main form and reloading the login form.

    EDIT: From the comments, it may be that all you are looking for is .Hide(). This doesn’t cause your form to unload and a call to .Show() will restore it (for example, you can use a timer or another form holding a reference to your main form to make the call). I prefer to use an ApplicationContext because it takes the responsibility for keeping your program in memory away from a UI element which the user may attempt to close.

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

Sidebar

Related Questions

I have an MDI application that initially doesn't have the main window open. When
Let's say I have a main form that can open MDI children inside it.
I have web application in that I have a ajaxTabedinterface. I want open the
I have a form frmMain set up as MDI Parent. Within that I can
I want to open an xlsx file, I have tried the below code,but neither
I want to open a pop-up window on click of 'link', then show some
i want to open a new pop up window when user click the button.But
I want to open a page in new tab of browser on button click.
I want open pdf file directly without asking open,save options(prompt window).In this temppath is
I want to open a save file dialog, have the user enter a filename,

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.