LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structure custom event for "Operate Menu Selection"

Solved!
Go to solution

Hi, I want my event structure to execute when user clicks on an enum and selects any value (even if it's the same value).

 

Value Change takes care of the first part but I can't figure out how to make even trigger when user clicks on the enum and selects the same value with either keyboard or the mouse. Operate Menu Activation only registers clicking on the enum and Operate Menu Dismissed shouldn't trigger the event since user cancelled the interaction.

I have tried using Key Up/Mouse Up and Key Down/Mouse Down but only Key/Mouse Down works and it's acts the same as Operate Menu Activation. 

 

Is there a simple way of achieving this or do I need to create a custom user event for this?

 

Thanks 

Screenshot 2024-01-15 130451.png

  

0 Kudos
Message 1 of 4
(584 Views)

Couldn't edit my first message, wanted to add that this is exactly what I'm trying to do, but no solution was found in that thread. 

https://forums.ni.com/t5/LabVIEW/Enum-drop-down-select-event/td-p/737280

0 Kudos
Message 2 of 4
(565 Views)

This adds complexity, but you could try to use a .NET combo box, where this does work.

 

A quick look at code where I have this shows that you also get the callback while navigating through the values with the keyboard and not just when making the final selection. There might be a way to handle that (for instance, I use the SelectedIndexChanged event and another event might only trigger on final selection), but I haven't checked.


___________________
Try to take over the world!
0 Kudos
Message 3 of 4
(521 Views)
Solution
Accepted by John32d

One option would be to force the user to always make a selection.

 

Add a default item like "Select" then reset to this item after getting the users selected item.

You will only get an event when an item other than "Select" is, well, selected.

Enum Value Change LV2018_BD.png

 

 

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 4
(501 Views)