110,534
社区成员
发帖
与我相关
我的任务
分享
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Thread thread = new Thread(new ThreadStart(delegate ()
{
CreateInstance(typeof(FormIndex), out Form frm);
Application.Run(frm);
}));
thread.IsBackground = true;
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
Application.Run(new CityWeatherClient.UIForm.FormImportTxt());
}
private static void CreateInstance(Type FormType, out Form frm)
{
object formObj = System.Activator.CreateInstance(FormType);
frm = formObj as Form;
if (frm == null)
{
throw (new Exception("Splash Screen must inherit from System.Windows.Forms.Form"));
}
}