C#在编写windows应用程序后,总是运行form1,我想运行调试form2,要怎样做

如题所述

修改Program.cs文件
应用程序入口函数里有一句
把Application.Run(new Form1());
修改为Application.Run(new Form2());
就可以了
温馨提示:内容为网友见解,仅供参考
第1个回答  2010-09-27
修改Program.cs 将Fror1改为Form2 即可

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form2());
}
}
}
第2个回答  2010-09-27
设form2为主窗口:应该有设置的,找不到的话改program.cs文件
第3个回答  2010-09-27
修改 Program.cs
相似回答