odi*_*seh 2 properties startup winforms
在项目属性窗口的应用程序选项卡和启动对象组合框中,我无法看到我的win表单,以便将其中一个设置为启动对象.
它出什么问题了?
打开Program.csStartUp项目的文件(在解决方案中选择作为StartUp项目的项目)并将参数更改Application.Run为所需的表单对象.这可能如下所示:
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1()); // <-- this line decides which form will be opened at start
}
Run Code Online (Sandbox Code Playgroud)
PS.它不一定是,Program.cs但默认情况下,确切地说它是包含静态方法的静态类的文件Main().