Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Axapta 动力学AX x++;can';不要关闭第一个窗体_Axapta_Dynamics Ax 2012_X++_Dynamics Ax 2009 - Fatal编程技术网

Axapta 动力学AX x++;can';不要关闭第一个窗体

Axapta 动力学AX x++;can';不要关闭第一个窗体,axapta,dynamics-ax-2012,x++,dynamics-ax-2009,Axapta,Dynamics Ax 2012,X++,Dynamics Ax 2009,我看到一个奇怪的情况,当使用FormRun两次打开表单时 static void Job780(Args _args) { FormRun formRun; Args args = new Args(); ; args.name(formstr(Form1)); formRun = ClassFactory.formRunClass(args); formRun.init();

我看到一个奇怪的情况,当使用FormRun两次打开表单时

static void Job780(Args _args) { FormRun formRun; Args args = new Args(); ; args.name(formstr(Form1)); formRun = ClassFactory.formRunClass(args); formRun.init(); formRun.run(); formRun.wait(); } 静态无效作业780(参数_参数) { FormRun-FormRun; Args Args=新Args(); ; 参数名称(formstr(Form1)); formRun=ClassFactory.formRunClass(args); formRun.init(); formRun.run(); formRun.wait(); } 如果我运行这段代码两次,就会看到两个表单,但在关闭第二个表单之前,我无法关闭第一个表单

我在几个实例和不同的版本上进行了尝试(2009年、2012年)。清除缓存和*.auc域。同样的结果


问题是如何修复它。我的意思是如何使表单以任何顺序正确关闭。谢谢。

这是因为您正在使用
formRun.wait()

使用
formRun.wait()如果要在窗体关闭之前停止执行

或者使用
formRun.detach()如果要让窗体单独运行