Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The CodeBehind tab is used to define a set of functions connected with a display. You can write code in either standard VB.Net or CSharp. You can also switch between the two. If you change your language selection, the system automatically converts existing code to the selected language.

If you need references to your own assemblies, use Run > Build > References.

CodeBehind functions can be executed when opening or closing, or while the display is open, depending on how you configure the code. You can use CodeBehind to define the mouse and input command handling methods to be executed on a specific display.

For Dialog displays, use the built-in DialogOnOK method, which is called when the built-in OK button on the dialog is pressed. If "True" is returned on that method, the dialog is closed; if "False" is returned, the dialog remains open. This method is commonly used to ensure data validation on the dialog and prompts the user to correct incorrect entries before closing the dialog.

The Code Behind of the Displays has the following pre-defined methods:

  • DisplayOpening()Executed when a display is opening.
  • DisplayIsOpen()Called in regular intervals while the display is open.
  • DisplayClosing()Executed when a display is closing.
  • DialogOnOK()Called when the OK button on a dialog display is pressed. Returning 1 allows the dialog to close. Returning 0 prevents the dialog from closing.

You can add your own .NET variables and methods to this page. 

Info

Because the client displays are designed to run on distributed environments as well as web environments, we recommend avoiding the use of functions that do not allow partial trust execution or that refer to physical file paths.


Info

Once the CodeBehind runs on the client side, the display will be locked when the code is running. To avoid locked displays for too long, choose Scripts (tasks and classes) if the code has too many procedures.



...