To download NI software, including the products shown below, visit ni.com/downloads.
Overview
Demonstrates a work-around to generate a "done scrolling" event even when the mouse drifts off the scroll bar.
Description
This example was made in response to a gap in the LabVIEW and Windows event feature set. When using a typical scrollbar, as long as you keep the left mouse button depressed, you keep control of the scrollbar; even if the mouse pointer drifts off of the scrollbar control. You may not even realize this until you think about it, or test your web browser, but it is fairly common for a user to start a scroll, then end up with their mouse on the other side of the screen.
This prevents an issue if you are interested in knowing when a user has finished a scroll event. There is no such thing as a "Done Scrolling" event. The "Mouse Up" event hardly helps, as it is not fired if the mouse drifts off of the scrollbar, which it commonly does. Check some of these links for users with the same frustrations:
http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=458604#M458604
http://forums.ni.com/ni/board/message?board.id=170&message.id=480721&requireLogin=False
The "Mouse Down" event should be a good indicator that the user has started a scroll. We can take advantage of the Input Device Control Palette in LabVIEW to read the status of the mouse once a scroll has started to poll for when the mouse button is released.
Requirements
LabVIEW 2012 (or compatible)
Steps to Implement or Execute Code
Additional Information or References
Front panel of the VI
In my testing, this did not work for a scroll wheel. would be interested in thoughts on how that would work.
Enjoy...
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.