ShowDialog([Parent: IWin32Window = Null]): Integer;
Parent is a parent window, relative to which the .NET form is modally opened. The Null value is passed by default, the .NET form is modally opened relative to current form.
The ShowDialog method shows the window of current .NET form modally relative to the current window and returns the result of the form execution.
Executing this example requires a form with the Button1 button. The repository contains a .NET assembly with the TestAssm identifier. The .NET form named TestForm is created in this assembly. The namespace of assembly corresponds to its identifier.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
Run: IForeNETRuntime;
Asm: IForeNETRuntimeAssembly;
RuntimeForm: IForeNETRuntimeForm;
FormResult: Integer;
Begin
MB := MetabaseClass.Active;
Run := ForeNETAssemblyClass.Runtime;
Asm := Run.Assembly(MB.ItemById("TestAssm").Bind As IForeNETAssembly);
RuntimeForm := Asm.Form("TestAssm.TestForm");
FormResult := RuntimeForm.ShowDialog;
End Sub Button1OnClick;
After executing this example, pressing the button from .NET assembly opens the .NET form. The .NET form is modally opened relative to the current form. Result of modal form closing is contained in the variable FormResult.
See also: