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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:20:41+00:00 2026-05-26T15:20:41+00:00

I have just switched from VB.Net to C# and am writing a windows application.

  • 0

I have just switched from VB.Net to C# and am writing a windows application.
In VB.net you could easily change the Shutdown Mode by selecting the properties of the
project and moving to a dropdown where you could choose between “When startup form closes”
and “When last form closes”. Please help me to find the equivalent in C#.

By the way, I’m using VS 2010.

  • 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-26T15:20:41+00:00Added an answer on May 26, 2026 at 3:20 pm

    In c# the easiest trick to achieve this is to change the entry point of the application in the “program.cs” file.
    This entry form should be hidden on startup,but will call the main form. Then call the Application.Exit(); function in the close procedure in any other form/class.

    Sample pseudo code below

    program.cs

    //edit this line
    Applcation.Run(startupForm);
    

    StratupForm.cs

    //startup method
    StartupForm_load (object e)
    {
    this.Hide();
    MainForm mainForm = new MainForm();
    mainForm.show();
    }
    

    MainForm.cs

     //application exit method
        MainFormExit_close (object e)
        {
         Application.Exit();
        }
    

    You should probably implement a neater way to manage and keep track of open forms later in your program

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

Sidebar

Related Questions

I have just switched from svn to mercurial and have read some tutorials about
I've just switched from radrails to netbeans. So far, so good. But I have
Have just started converting an existing job tracking system into an ASP.NET MVC application.
I am new to c#/.net and just switched over to it from classic asp(yesterday).
I have just switched from Java Server Faces JSF 1.x to JSF 2.x. Files
I have just started using xcode 4.3.2 on lion (switched from snow leopard) and
Just switched to Mac from Windows and in ppt on Windows I had an
I just switched over to WPF from just regular C# .NET for the more
I have just switched from a shared hosting environment to a dedicated service and
In order to do some multi-platform GUI development, I have just switched from GTK

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.