About the IWSForm interface

To access the IWSForm interface, use the following methods and properties of the IWSApplication interface:

  • Application.Forms property
  • ThisForm property
  • Application.ActiveForm property
  • Application.FindForm() method

This example assigns an IWSForm interface value to a variable.


   '  Assign the form named MyFormName to oMyForm
   Dim oMyForm As IWSForm
   oMyForm = Application.Forms("MyFormName")
   '  Set the caption of MyFormName to "My Form Caption"
   Application.Forms("MyFormName").Caption = "My Form Caption"

The current form

Since most WinStudio scripts work with the currently active form, WinStudio provides the ThisForm property for accessing the current form. The following line of code sets the caption of the currently active form.


   '  Set the caption of the current form to "My Form Caption"
   ThisForm.Caption = "My Form Caption"

Generating a form event

You can use the GenerateEvent method to generate any form event. This is often used to programmatically initiate actions that are normally initiated by the user. For instance, the following code generates the form refresh event.


   '  Refresh the form
   ThisForm.GenerateEvent("StdFormRefresh")

Standard events and any custom events can be generated programmatically.

Methods and properties

See IWSForm interface.