简单的启动窗体
public static System.Threading.Thread thread;
public static ce.About welcomefrm;
[STAThread]
static void Main()
{
System.Threading.ThreadStart start=new ThreadStart(ce.ceStart.splashForm);
thread=new Thread(start);
thread.Start();
//做要做的事
//运行主程序
System.Windows.Forms.Application.Run(new ce.Forms.coolmain());
}
static void splashForm()
{
ce.ceStart.welcomefrm =new About();
ce.ceStart.welcomefrm.Show();
Application.DoEvents();
ce.ceStart.welcomefrm.Activate();
thread.Join(2000);
ce.ceStart.welcomefrm.Close();
ce.ceStart.thread.Abort();
}
博客展示了使用System.Threading.Thread启动窗体的代码示例。定义了线程和窗体对象,通过ThreadStart指定要执行的方法,启动线程后执行相关操作,最后关闭窗体并终止线程。
8551

被折叠的 条评论
为什么被折叠?



