Event Handler

From LabVIEW Wiki
Jump to: navigation, search

The Event Handler design pattern provides a powerful and efficient architecture for handling user interaction with LabVIEW. Use the event handler for detecting when events occur such as a user changing the value of a control, moving or clicking the mouse, or pressing a key, etc. The standard event handler template consists of an Event structure contained in a While Loop. Configure the Event structure to have one case for each category of event you want to detect. Each event case contains the handling code that executes immediately after an event occurs.


Event Handler Design Pattern

Use Cases

Dialog Boxes

Creating New from Templates in the LabVIEW IDE

The Event Handle is suited for use in simple dialog boxes where there might be some input like a message presented to the user, the user makes a selection, and then the users' choice is the output. From File -> New..., then listed in the "From Template\Frameworks" folder there exists a template for making simple dialog boxes with OK and Cancel selections.