在Visual Studio中新建了一个类库项目,后来添加了个窗体,作为启动窗体。由于不是新建的windows forms 应用程序上,VS中没有自动添加启动项目,运行时显示没有启动项目。

解决方法:手动添加主函数,代码如下:

class program

    {

        [STAThread]

        static void Main()

        {

System.Windows.Forms.Application.EnableVisualStyles();     

System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);

System.Windows.Forms.Application.Run(new MainGIS());

        }

}

相关文章:

  • 2022-12-23
  • 2021-11-16
  • 2021-12-24
  • 2022-12-23
  • 2021-04-20
  • 2022-12-23
  • 2021-12-23
猜你喜欢
  • 2021-09-28
  • 2022-12-23
  • 2021-09-09
  • 2021-09-26
  • 2021-06-20
  • 2021-06-03
  • 2021-04-03
相关资源
相似解决方案