如何从 class 代码关闭进程?
How to close the process from class code?
我叫一个class表格MyForm
。在我的 class 中,我有 if-else
个语句。我想关闭所有进程。我需要一个看起来像
的命令
element.close();
例如,我的代码:
if (_condition a_)
{
//operations class;
}
if(_condition b_)
{
//abort all, and close all;
}
状态不佳怎么办?我会通过 class.
中的代码关闭所有循环
您可以使用 FormRun class 启动您的表单,然后使用 formRun.close() 再次关闭它。当您希望表单保持打开状态并等待用户的操作时,请记住调用 formRun.wait()。
static void openCloseForm(Args _args)
{
FormRun formRun;
Args args = new Args();
args.name(formstr(MyForm));
formRun = ClassFactory.formRunClass(args);
formRun.init();
formRun.run();
if (_condition a_)
{
//operations class before user input;
formRun.wait();
//operations class after user input;
}
if(_condition b_)
{
formRun.close();
}
}
我叫一个class表格MyForm
。在我的 class 中,我有 if-else
个语句。我想关闭所有进程。我需要一个看起来像
element.close();
例如,我的代码:
if (_condition a_)
{
//operations class;
}
if(_condition b_)
{
//abort all, and close all;
}
状态不佳怎么办?我会通过 class.
中的代码关闭所有循环您可以使用 FormRun class 启动您的表单,然后使用 formRun.close() 再次关闭它。当您希望表单保持打开状态并等待用户的操作时,请记住调用 formRun.wait()。
static void openCloseForm(Args _args)
{
FormRun formRun;
Args args = new Args();
args.name(formstr(MyForm));
formRun = ClassFactory.formRunClass(args);
formRun.init();
formRun.run();
if (_condition a_)
{
//operations class before user input;
formRun.wait();
//operations class after user input;
}
if(_condition b_)
{
formRun.close();
}
}