LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enum pull-down doesn't generate value change event, only scroll buttons.

I inherited some code that uses enum controls. I created an event structure to trigger when an enum value change occurs. The event triggers only when the scroll buttons are used, not when the value is changed using the pull-down list. Is there a property that controls this behavior?

 

I have written test code using an enum control and it behaves as expected, i.e., both the scroll buttons and pull-down menu generate a value change event.

0 Kudos
Message 1 of 9
(4,106 Views)

Can you post your vi which inherited from someone else?

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 2 of 9
(4,094 Views)

If you pop up the menu list and release it without changing to a different value, you have not changed the value and the event will not occur. You should get an event if the value actually changes.  Is it possible that this is what you are seeing?

 

Lynn

0 Kudos
Message 3 of 9
(4,065 Views)

And how do you detect an event when the user does not change the value of the enum control?

0 Kudos
Message 4 of 9
(3,935 Views)

You could use the mouse up event. So if they click on the drop down it would register on the up click of the mouse.

Tim
GHSP
0 Kudos
Message 5 of 9
(3,932 Views)

That's what I thought too, but it doesn't generate an event. Actually I've read that the control's drop down list is reading the mouse up event, making it no longer usable by the programmer.

0 Kudos
Message 6 of 9
(3,929 Views)

Mouse down works but you may get two changes if the mouse down and they change the value. If that is ok then mouse down would work for you.

Tim
GHSP
0 Kudos
Message 7 of 9
(3,927 Views)

The enum is not really intended as a UI control, but the same can not be said for the ring and since this little annoyance also exists for the ring I can't simply say "Don't use an enum as a UI control".  I would add a suggestion to the Idea Exchange that selecting the existing value from the popup menu fires either the 'Operate Menu Dismissed' or Value Changed event (I'd have to think about which I would prefer, probably value change since it is easy to compare the new and old values).

 

The Combo Box will fire a Value Changed Event even if you do not change the value, but this control is not a direct replacement for the ring.  If you want to ensure that the user makes a choice, I suggest you force the user to make a choice.  Two ways to do this:  One is to add a blank or <Select Something> element to a ring which the user must change.  The second is to add an ok button which when clicked tells you the user is done futzing with your menus.

0 Kudos
Message 8 of 9
(3,908 Views)

I believe what Jabdo56 is saying is Enum mouse up event doesn't fire when the action is mouse up on the list box. It work just fine when the increment/decrement button is used. Enum maybe a derived UI control but this is a flaw of the event structure. It should be addressed.

 

I too noticed this in a project of mine, I work around it by using value change, then added mouse up with Ctrl key pressed to generate repeated value (ok beyond the point here). Point is this needs fixing.

0 Kudos
Message 9 of 9
(3,882 Views)