LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mouse wheel problem with scroll bar and value change event

I have an event that triggers when the value of a scroll bar changes. This works fine with everything but with the mouse wheel. At first, the mouse wheel will change the value of the scrollbar, but this won't trigger the event. If I then trigger the event with a mouse click, the mouse wheel will then start to trigger events as well. Then switching to another object makes it revert to not recognizing mouse wheel value changes.

 

Is there a way to make it recognize the mouse wheel without having to change the value of the scroll bar with a click first? I've attached a sample vi.

0 Kudos
Message 1 of 21
(5,442 Views)

Hi hbcnb

 

For me your example works as long as the mousepointer is over the scrollbar. Please have a look at this thread (post 12) for an example on how to use the mouse wheel as an event trigger instead.

 

Best Regards

 

David

NISW

0 Kudos
Message 2 of 21
(5,408 Views)

I sort of saw the behavior you are talking about.  When I first open it, the event values didn't change when I scrolled the wheel while it hovered over the scroll bar.  When I clicked on it, then it would fire events after that.  Even when I stopped and restarted the VI, it would continue to work.  Clicking elsewhere, the scrolling still worked.  (This is a bit different than what you described where you said clicking elsewhere caused the scroll events to stop working.)

 

Part of me says there is somehow a focus action going on that is allowing or not allowing the value change event to fire.

 

If you duplicate your code and do two scroll bars, and two event cases, and another polling loop, how does it behave.  I tried that, and the scrolling behavior fell apart.  I just tried again and LV2009 crashed on me.  It disappeared with no message.  I was able to recover the VI, but there was no message about error logs.

 

I'm going to attach that VI for others to play with.  WARNING:  Make sure you have all of your other LV VI's saved so that it doesn't close them out as well if it crashes.

 

David, that link you posted is a dead end.  Reply 12 just points to a LAVA link that is no longer present on the LAVA servers.

Message Edited by Ravens Fan on 12-01-2009 10:16 AM
0 Kudos
Message 3 of 21
(5,399 Views)

darn, I used that just a while ago but I don't think I have it saved anywhere (new computer)....sorry.

I'll try your VI right after finishing some other things

 

Best Regards

 

David

0 Kudos
Message 4 of 21
(5,395 Views)

Ravens Fan:

 

You're right, you have to do more than just click off the scroll bar control to make it stop triggering value change events with the mouse scroll. It looks like you have to make a value change in another control to do this.Just clicking on another control will not do it. Also, just clicking on the scroll bar does not cause the mouse wheel to start triggering value change events. You have to actually make the value change. At least that's what I'm finding

0 Kudos
Message 5 of 21
(5,385 Views)

I've found much the same thing. If you open the VI and run it the event won't fire until you change the value of the scrollbar with the mouse, simply clicking on it won't help. I haven't been able to reproduce the crashes with two scrollbars, I get the same behavior as with one. Have you been able to get it to crash again Ravens Fan?

 

Best Regards

 

David

0 Kudos
Message 6 of 21
(5,355 Views)

Davidek wrote:

I've found much the same thing. If you open the VI and run it the event won't fire until you change the value of the scrollbar with the mouse, simply clicking on it won't help. I haven't been able to reproduce the crashes with two scrollbars, I get the same behavior as with one. Have you been able to get it to crash again Ravens Fan?

 

Best Regards

 

David


I was able to reproduce it.

 

Please watch the attached swf file.

I just open the VI

Run the VI

Without clicking on anything else hover over the first scroll bar

Then I did (scroll, scroll, scroll) three scrolls of appx equal durations and with appx equal gaps in between. 

The duration I used was small. 

0 Kudos
Message 7 of 21
(5,350 Views)

Tried it, but mine doesn't crash. Which version of LV are you on? If it's 2009 do you have f2?

 

Best Regards

 

David

0 Kudos
Message 8 of 21
(5,345 Views)

I tried it on LV 2009 and LV 8.6. I don't remember installing f2 patch :). I'll install the f2 patch and get back to you. In the mean time, I have filed CAR# 198046 for this crash. I will post updates if any more info is required.

 

Davidek, try scrolling furiously and check if it is crashing for you.

0 Kudos
Message 9 of 21
(5,343 Views)

Tried that too, stil no crash

 

/David

0 Kudos
Message 10 of 21
(5,341 Views)