How to set up a startup Form in Windows application





Start up page in Windows Application.

Its been an year and a half since i ve used Windows Application.So I thought of creating a Windows application.

Hope u are Familiar with Windows Forms.

An application may ( may not )contain Many forms.The startup form is the first form that is launched when your application is executed. By default, a Windows Forms project creates a default form when the project is created. This form is set as the startup form.In , case if we need to change the default Form and select another form as the Start up form.We need to follow certain steps. Those Steps to be followed are given below.

*** Open the Solution explorer, You can use the short cut to open it. Ctrl+Alt+L
*** Open open the program .cs File.
You will see the code shown below in it. Replace the Form1 Name with the name of the form which you want to set up the First page.

In C#:

 static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FormName());
        }


Here we use the Application class ,
The Application class provides static methods to manage an application like running, closing, and managing windows messages. In the method Main of the application we can start running the application using the Run of the Application class.To stop Running the application we can call Exit Method .

HappyCoding ! 😉

Advertisements

10 responses to this post.

  1. Posted by sanam on June 20, 2011 at 8:33 PM

    Thanks
    Its very simple ..

    Reply

  2. Thank u Sanam for ur comment

    Reply

  3. Posted by A.J.Abraham on December 13, 2011 at 4:57 PM

    Thanks Dude

    Reply

  4. Thanks Abe…..

    Reply

  5. Posted by iff! on January 16, 2012 at 6:46 PM

    thanks thanks thanks

    Reply

  6. Hi All,
    Thanks for visiting my blog and commenting here.

    Reply

  7. Posted by Marcelo on March 18, 2012 at 8:24 AM

    Thx

    Reply

  8. Posted by Sethu on January 24, 2013 at 3:13 AM

    Thanks….Thanks….Thanks….Thanks….Thanks….Thanks….Thanks….Thanks….Thanks….A lot……..

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: