Click here to Skip to main content
15,907,281 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
MY CODE:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Banking_System
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new //Form1());      
             
               }   //in this bracket only
      }
}


What I have tried:

I didn't get the exact problem. This is program.cs code from my Banking_System software.
Posted
Updated 23-Aug-16 18:17pm
v2
Comments
Garth J Lancaster 23-Aug-16 21:57pm    
Im presuming this is a WinForms project you've generated, yes ? does your program actually have a 'Form1.cs' form or did you rename or delete it ?? if you've renamed Form1.cs (etc) that's the item required in the Application.Run(); statement

It wants you to finish
C#
Application.Run(new //Form1());

because
C#
//Form1());

is a comment.
 
Share this answer
 
Obviously, in that line
C#
Application.Run(new //Form1());   
a comment is started but that statement is then incomplete.

You should remove the // and the code should compile provide that Form1 do exist.

If this is not the case, then you have to replace it with whatever is the name of your application main form. If you simply use Form, then you would get an empty main form.
 
Share this answer
 
it should be
C#
Application.Run(new Form1());


if you have renamed the Form Name, then you should update the line as
C#
Application.Run(new YourNewFormName());


note:This will be the starting form of your application.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900