Step 2: Design an Event Case to Specify When You Want LabVIEW to Register for the Event

In this example, the Mouse Down event case contains the Register For Events function that registers the Mouse Move event. When the user clicks the picture control on the front panel, the Event structure executes to handle the Mouse Down event and the code in the Mouse Down event case executes to register the Mouse Move event on the pane reference.

What to Use

Use the following block diagram objects to modify event registration dynamically.

VI Server Reference Register For Events







 Add  Find
 Add  Find

What to Do

Create the following block diagram so LabVIEW registers the Mouse Move event on a valid object at run time.

The following list describes important details about the previous step.

To modify the existing registration, wire the event registration refnum output of a Register For Events function to the top left input of another Register For Events function. When you wire the event registration refnum input, the function automatically resizes to show the same events on the same types of references as you specified in the Register For Events function that originally created the event registration refnum. You cannot manually resize or reconfigure the function while the event registration refnum input is wired.
Wire the Pane reference to the Mouse Move event to replace the registered placeholder. When the user clicks the picture control, the Event structure executes to handle the Mouse Down event and LabVIEW registers the Mouse Move event.

After you design an event case to specify when you want LabVIEW to register for the event, unregister for the event before you unregister for all events.