|
-
Nov 12th, 2021, 05:52 AM
#1
Thread Starter
Addicted Member
Detect if panel scrollbar being used
Hi
I've got a panel with a label control inside. It's set to autoscroll.
I'm updating the label every 5 seconds (on a timer) with the last 20 lines of a text file via a background worker.
The background worker sets the vertical scrollbar on the panel to maximum each time, so that it scrolls to the bottom and the user sees the most recent text file entries.
So far so good - what I'd now like to do is to skip the label update if the user is dragging the scrollbar when the timer fires.
To do this, I thought I could set a flag using MouseEnter and MouseLeave events - so if the mouse is within the control, it flags as true and the timer doesn't start the background worker. When the mosue leaves, the flag is false, and the timer fires on the next tick.
This fails because the MouseEnter does not fire when the mouse is over the scrollbar itself.
I can use the Scroll event, but there's no 'Scroll off' event to signify the user has stopped scrolling.
This is one of those things which you feel should be simple, but it has got me stumped at the moment! - could anyone suggest a solution please?
Thanks
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|