通过修改Main方法中的 Application.Run(……)语句,设置默认的启动窗体。Main方法在Program.cs文件中。
例如,以下代码将OrderPrintHelper作为启动窗体:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new FormLogin()); //设置默认启动窗体
Application.Run(new OrderPrintHelper()); //设置默认启动窗体
}
}
}