【发布时间】:2013-12-07 15:58:48
【问题描述】:
我正在使用 OpenFileDialog 打开我想在我的应用程序中处理的文件,但处理需要几秒钟,并且在处理期间 OpenFileDialog 保持可见,而且很烦!!! 我想在处理期间隐藏我的 OpenFileDialog! SaveFileDialog
也有同样的问题private void ofdImportation_FileOk(object sender, CancelEventArgs e)
{
Processing(); //Takes Few Seconds
//ofdImportation remains visible during that time...
//i want to hide it...
}
谢谢大家...
【问题讨论】:
-
在你的事件处理程序中进行处理是不好的形式,你能不能把
Processing()的执行移到执行主体中? -
只有它们的像素仍然可见。你的 UI 线程对世界来说已经死了,所以它不会重新绘制你的窗口。您可以将
this.Update();放在 Processing() 调用之前作为一种简单的解决方法。
标签: c# openfiledialog savefiledialog