Altova StyleVision 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 (



ShowForm(strFormName : String) -> result : Integer



The following JScript code


var dialogResult = ShowForm( "FormName" );


Shows the form "FormName" as a dialog box:


The DialogResult can subsequently be evaluated, for example:


if ( dialogResult == CLR.Static( "System.Windows.Forms.DialogResult" ).OK )
   alert( "ok" );
   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).

© 2018-2024 Altova GmbH