Add a Touch Event to a project screen

Add a Touch Event to a project screen in order to process touch input on the screen in general, rather than on a specific object in the screen.

Before you begin this task, you should have the selected Screen worksheet open for editing.

Touch Events are added to a project screen through the Screen Script worksheet.

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

To add a Touch Event to a project screen:

  1. Do one of the following:
    • On the Graphics tab of the ribbon, in the Screen group, click Script; or
    • Right-click anywhere in the screen worksheet, and then click Screen Script on the shortcut menu.

    The screen’s associated script worksheet is opened for editing.

  2. Right-click anywhere in the script worksheet, and then point to Add Touch Event on the shortcut menu. A sub-menu of the available Touch Events is displayed.
  3. On the sub-menu, click the Touch Event that you want to add.
    Option Description
    Sub Screen_OnTouch Process the raw data from the touch input. The sub-routine is continuously executed while the user touches the project screen.
    Sub Screen_OnTouchStart Perform an action once, when the user starts touching the project screen.
    Sub Screen_OnTouchDelta Perform an action each time the user moves his or her fingers on the project screen.
    Sub Screen_OnTouchCompleted Perform an action once, when the user stops touching the project screen.

    The Touch Event is inserted as a VBScript sub-routine in the Screen Script worksheet.

  4. Click in the worksheet and 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 project screen