你看一下你的程序的Main函数,是不是如下的样式:[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
或者可以请教一下如何用后台线程处理导出吗?
谢谢
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.FileName = fileName;
saveFileDialog1.Filter = "excel文件(*.xls)|*.xls|所有文件|*.*";
if (saveFileDialog1.ShowDialog() == DialogResult.OK)题(见下描述)
{
System.Threading.Thread exportThread = new System.Threading.Thread(new System.Threading.ThreadStart(ExportRunning));
exportThread.Start(); }