.NET Control object

.NET Components are designed according to the Microsoft .NET Framework, which is a standard for modular programming technologies. Because IWS is a .NET container, you can configure and run .NET Components in your project screens. The actual functions of a .NET Component are contained within a .NET Control object, which provides the configuration dialogs.

.NET Components include the following interfaces:

The properties, methods and events supported by each .NET Component vary according to the component's implementation.

CAUTION:
When using .NET Components in your project, make sure that the target system (runtime station) can support the same components and that they are properly installed and registered. Your project includes links to the .NET Components; however, the installation of these components on the target system must be done separately. Furthermore, when .NET Components are used on screens open in remote Thin Clients, the .NET Components must also be manually installed on the Thin Client stations. The Microsoft Windows operating system installs a large selection of components by default, but additional components are offered by third-party providers. Consult your .NET Component provider for further information about how to install.

Selecting and Placing a .NET Control Object

To select and place a .NET Control object in your project screen:
  1. On the Graphics tab, in the Libraries group, click .NET Control.
  2. When the .NET Framework Components dialog opens (as in the following figure), it contains a list of all .NET Components that are registered on your computer.
    Figure 1. .NET Framework Components dialog

  3. Select a component from the list, and then click OK to place it in your project screen. You can also click the Browse… button to find an unregistered component on your computer.
    Tip: Registered .NET Components are typically stored in the following directory:
    C:\WINDOWS\Microsoft.NET\Framework\
    
    However, you can have the application include unregistered components in the .NET Framework Components dialog by editing the project_name.APP file to add this parameter:
    [Execution Environment]
    DotNetControlPath=OptionalPath
    
    For example:
    [Execution Environment]
    DotNetControlPath=C:\DOTNET CONTROLS BACKUP
    

    Thereafter, the .NET Framework Components dialog will list all registered components and all components found in the specified directory.

  4. By default, a new .NET Control object is placed in the upper-left corner of your project screen. Click on the object and drag it to where you want it placed.
  5. Once the object is placed, double-click on it to open its Object Properties dialog.
    Figure 2. Object Properties: .NET Control

The Object Properties dialog shows the name of the .NET Component. You must assign a name (alias) to the component in the Name box (e.g., CheckBox1). This name is used to reference the component when using the scripting languages (VBScript and built-in scripting).

Note: You should not configure two .NET Control objects on the same screen with the same name. For instance, if you place two CheckBox components on the same screen and assign the name CheckBox1 to one object (Name field), you cannot assign the same name to the second object on the same screen. You would have to assign the name CheckBox2, for example, to the second object.

The Property Pages button opens the standard window for configuring the Static Properties (if any). The layout and the options in this dialog depend on the implementeation of each .NET Component. Use this interface to set properties that should not be changed during runtime (fixed properties).

The Members button on the Object Properties dialog opens additional dialogs that allow you to do the following:
  • Associate tags to properties of the .NET Component
  • Trigger methods from the .NET Component based on tag change
  • Configure scripts, which are executed when Events from the .NET Component occur

The following sections describe how to configure these interfaces.

Note: Although the Members dialog displays the list of all properties, methods and events, you only have to configure the items that you need for your project.

The screen shots used in the following sections depict the CheckBox component. Although the names of properties, methods and events varies by component, the configuration interface is the same for any .NET Component. The concepts described here apply to all of them.

Configuring Properties

The Properties tab provides a grid with the following fields:
Figure 3. Members Dialog – Properties tab

  • Property: List all properties available from the .NET Component, and indicate their types:
    Property Icon Property Type
    Boolean
    Integer
    Real
    String
  • Tag/Expression: The tag configured in this field is associated with the respective property of the .NET Component. The Action column will define whether the value of this tag will be written to the property, or if the value of the property will be written to this tag (or both).
  • Action: Defines the direction of the interface between the tag or expression configured in the Tag/Expression field and the .NET property, according to the following table:
    Action Description
    Get Read the value of the property and write it to the tag configured in the Tag/Expression field.
    Set Write the value from the tag or expression configured in the Tag/Expression field into the property.
    Get+Set Executes both actions (Get and Set). However, when opening a screen with the .NET Component, IWS executes the Get command before executing any Set command. That is, the tag configured in the Tag/Expression field is updated with the value of the property when IWS opens the screen where the .NET Component is configured.
    Set+Get Executes both actions (Get and Set). However, when opening a screen with the .NET Component, IWS executes the Set command before executing any Get command. That is, the property is updated with the value of the tag configured in the Tag/Expression field when IWS opens the screen where the .NET Component is configured.
    Note: When the value of the property is "Read-only" (cannot by overwritten by your project), the Action field is automatically set to Get.
  • Scan: Defines the polling method to get values from the propreties. For .NET Components, all properties scan Always by default. That is, IWS keeps polling the value of the property and updating the tag configured in the Tag/Expression field with this value.

Configuring Methods

The Methods tab provides a grid with the following fields:
Figure 4. Members Dialog – Methods tab

  • Method: Lists all methods available from the .NET Component.
  • Parameters: The tags configured in this field are associated with the corresponding method. If the method does not support any parameter, then the fixed text <None> is displayed. Otherwise, you can enter the tags that you want to associate with the parameter. When the method has more than one parameter, you can enter one tag for each parameter, separating them by a comma (,). For example, TagA , TagB , TagC.
    Tip: When you click the Browse button (), it will display the list of parameters supported by the method, allowing you to associate one tag with each parameter.

    When the method is executed, either the value of the tags are written to the parameters of the method (input parameters), or, after the method is executed, the .NET Component writes the value of the parameters to the tags (output parameters).

  • Trigger: When the tag configured in this field changes value, the respective method of the .NET Component is executed.
  • Return: The tag configured in this field receives the value returned by the method (if any).

Configuring Events

The Events tab provides a grid with the following fields:
Figure 5. Members Dialog – Events tab

  • Event: Lists all events available from the .NET Component.
  • Parameters: The tags configured in this field are associated with the corresponding event. If the event does not support any parameter, then the fixed text <None> is displayed. Otherwise, you can enter the tags that you want to associate with the parameter. When the event has more than one parameter, you can enter one tag for each parameter, separating them by a comma (,). For example, TagA , TagB , TagC.
    Tip: When you click the Browse button (), it will display the list of parameters supported by the event, allowing you to associate one tag with each parameter.

    When the event occurs, either the value of the tags are written to the parameters of the method (input parameters), or, after the event occurs, the .NET Component writes the value of the parameters to the tags (output parameters).

  • Script: The script configured in this field will be executed when the event is triggered by the .NET Component.
    Tip: When you click the Browse button (), it will display a dialog with the complete script associated with the event. The main dialog displays only the expression configured in the first line of the script.