我在OnChanged()中使用对话框结果,(FileSystemWatcher)如下:
if (dialogResult == DialogResult.Yes)
{
new Form2().Show();
}
但是当我单击“是”按钮时,新表格被挂起(未响应),请告知。
完成是这样的:
var frm = new Form2()
if (frm.ShowDialog()==DialogResult.Yes)
{
//write your code here
}
Form2 frm=new Form2;
frm.Show();
frm.Hide();
if (dialogResult == DialogResult.Yes)
{
// For calling a GUI For inside thread On FileSystemWatcher using Invoke
frm.Invoke((MethodInvoker)delegate {
frm.Show();
});