Add a Touch Event to a screen object

Add a Touch Event to a screen object in order to process touch input on that object.

Before you begin this task, you should already have the screen worksheet open for editing. You should also have created the screen object to which you want to add the Touch Event.

Touch Events are added to a screen object through the Command animation.

Note: Touch Events are not supported on Windows Embedded Compact.

To add a Touch Event to a screen object:

  1. Click the screen object to which you want to add the Touch Event. The screen object is selected.
  2. On the Graphics tab of the ribbon, in the Animations group, click Command. The Command animation is added to the selected screen object.
  3. Double-click the screen object. The Object Properties dialog is displayed.
  4. If the Command animation properties are not already displayed, then in the properties list (in the top-right corner of the dialog), click Command.
  5. If the VBScript event tabs are not already displayed, then in the Type list, click VBScript.
    Figure 1. VBScript event tabs in the Command animation properties
    Web Studio Help dialog objectproperties command Add a Touch Event to a screen object

  6. In the VBScript event tabs, click the tab for the Touch Event that you want to add. You may need to use the arrow buttons to scroll through the tabs.
    Tab Description
    On Touch Process the raw data from the touch input. The sub-routine is continuously executed while the user touches the screen object.
    On Touch Start Perform an action once, when the user starts touching the screen object.
    On Touch Delta Perform an action each time the user manipulates on the screen object.
    On Touch Completed Perform an action once, when the user stops touching the screen object.
  7. Click in the text box below, and then type your VBScript code.

At this point, you can develop the Touch Event just as you would develop any other VBScript sub-routine in your project. For more information, see Overview of VBScript.

Add a Touch Event to a screen object