If you move the mouse outside the control while it is pressed, the mouse release on "A" is no longer possible. Maybe you could use a mouse leave event to substitute in that case.
Note that the LED belongs after the case structure. No need for local variables.
Thanks for your answer altenbach. But I tested your program and found that there is still this problem. Attached is the video of the test. During the test, the mouse was held in the air, and the mouse pointer remained on the array and did not move. Please check. Thank you.
Thanks for he clarification. Now that you show what to look for, I do see the problem very occasionally.
(My suggestion addressed a very specific problem, but this seems to be different.)
I am not sure where the problem is, it could even be in the mouse driver or OS. Maybe we just need to find a better solution. Can you explain the purpose of what you are trying to do?
Thanks for your help, altenbach. I ran into this bug when trying to select some elements in an array with the mouse. Sometimes you need to use the mouse to press and release to select a subset of the array, and sometimes you need to click to select one element. The bug is sometimes triggered when clicking to select one element, i.e. the program is still selecting after the mouse is released. Attached is the original vi. Do you have a better solution?
Yes, this is obviously a bug and I was not able to reliably program around it.
I took the liberty to simplify your code a little but (no change in functionality, bug still occurs!) to show how to make things simpler and better.