我的主程序 frm_pic 运行很慢
所以我想做个进度条窗体
我参考了
愚翁http://blog.csdn.net/knight94/archive/2006/05/27/757351.aspx的多线程方法
的确可以弹出进度条窗体,可是是先打开主窗体然后再打开进度条,
不但没有起到进度条的作用,反尔带来了一些其他问题
后来我就为了美化做了一个假进度窗体
控制一定时间后就 frm_load.hide()
感觉总不爽,资源没有清除而且发现最终资源也清除不干净现在我只想先启动 进度条窗体 也好
先启动主窗体也好 在主窗体 启动的那段时间能把他利用起来有个软件启动界面
启动界面完成后就可以迅速打开主窗体谁告诉我怎么做啊
所以我想做个进度条窗体
我参考了
愚翁http://blog.csdn.net/knight94/archive/2006/05/27/757351.aspx的多线程方法
的确可以弹出进度条窗体,可是是先打开主窗体然后再打开进度条,
不但没有起到进度条的作用,反尔带来了一些其他问题
后来我就为了美化做了一个假进度窗体
控制一定时间后就 frm_load.hide()
感觉总不爽,资源没有清除而且发现最终资源也清除不干净现在我只想先启动 进度条窗体 也好
先启动主窗体也好 在主窗体 启动的那段时间能把他利用起来有个软件启动界面
启动界面完成后就可以迅速打开主窗体谁告诉我怎么做啊
/////////////////////////////////////////////////////////////////////////////
using System;
using System.Windows.Forms;namespace StartAppTemp
{ public class StartApp
{
public StartApp()
{
} [STAThread]
static void Main()
{
StartApp.StartContext startContext = new StartApp.StartContext();
Application.Run(startContext); StartApp.MainFormContext mainFormContext = new StartApp.MainFormContext();
Application.Run(mainFormContext); } public class StartContext : ApplicationContext
{
private Form form; public StartContext()
{
form = new Form();
form.Closed += new EventHandler(form_Closed);
form.Show();
} private void form_Closed(object sender, EventArgs e)
{
ExitThread();
} } public class MainFormContext : ApplicationContext
{
private Form mainForm; public MainFormContext()
{
mainForm = new Form();
mainForm.Closed += new EventHandler(form_Closed);
mainForm.Show();
} private void form_Closed(object sender, EventArgs e)
{
ExitThread();
}
}
}
}
这样会出错