Altova UModel 2024 Enterprise Edition

Instantiates a new form object from the given form name and immediately shows it as dialog box. The return value is an integer that represents the generated DialogResult (System.Windows.Forms.DialogResult). For the list of possible values, refer to the documentation of the DialogResult Enum (https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.dialogresult?view=netframework-4.8).

 

Signature

ShowForm(strFormName : String) -> result : Integer

 

Example

The following JScript code

 

var dialogResult = ShowForm( "FormName" );

 

Shows the form "FormName" as a dialog box:

scr_cmd_showform

The DialogResult can subsequently be evaluated, for example:

 

if ( dialogResult == CLR.Static( "System.Windows.Forms.DialogResult" ).OK )
   alert( "ok" );
else
   alert( "cancel" );

 

Note:The code above will work only if the DialogResult property of the "OK" and "Cancel" buttons is set correctly from the Properties pane (for example, it must be OK for the "OK" button).

© 2017-2023 Altova GmbH