如何在午餐期间锁定表单 class?

How to lock Form during lunch a class?

我有一个简单的表单 MyCustomForm,在表单的按钮中 Clicked 方法 我调用了一个 Class(方法 运行), 所以我想在 运行 执行期间锁定(或阻止)此表单。

我的代码是这样的:

void clicked()
{// in Button clicked in **MyCustomForm**
     MyClass myClass;
     super();
     myClass = new MyClass();

     // here I want to freeze my FORM 
     myClass.run();
    // here I want to unlock my Form
}

我需要这个,因为当 class (MyClass) 是 运行ning 时可以显示对话框等,但我不想要 touc/click 和其他 MyCustomForm

如果我使用:

element.wait(); // not work well - block all
myClass.run();

谢谢, 享受。

如果您的 class 显示对话框,您可以使用以下代码行 dialog.parmIsModal(true) 使该对话框成为模态对话框。 或 formRun.wait(true) 表格。