Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Console Keeps On Popping Up On Form Application

Tags:

c#

winforms

When I run the following code, I want just my form to show up and not the console. How can I get this to work this way?

namespace NameSpace1
{
    public class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}
like image 518
sooprise Avatar asked Jan 23 '23 00:01

sooprise


1 Answers

Did you check your project properties? The output type may be set to 'Console Application' on the 'Application' tab.

like image 191
Sandor Drieënhuizen Avatar answered Jan 27 '23 02:01

Sandor Drieënhuizen