When a new Windows Forms Project is created , you would see the sourcecode similar to the below sample in the Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace WindowsFormsApplication1 { static class Program { [STAThread] static void Main() { Application.Run(new Form1()); } } }
What does the Application.Run do ?
The Application.Run will run the standard application message loop in the current thread where the Application runs.
The Application.Run also takes the parameter of type Form
Application.Run(new Form1());
In this case , the specified form is made visible too.
Leave a Reply