Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello folks, It's been a while since I last posted here...

 

I would love to know how can I startup my .NET v2.0 project with a class instead of a form. I could do this in v1.1 but I don't know how to do this in 2.0.

 

Thank you :)

Posted
You should have a Program.cs file that looks something like:
static class Program
{
   /// <summary>
   /// The main entry point for the application.
   /// </summary>
   [sTAThread]
   static void Main()
   {
       Application.EnableVisualStyles();
       Application.SetCompatibleTextRenderingDefault(false);
       Application.Run(new frmMain());
   }
}

Instead of calling Application.Run you can just create a new instance of your class.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...