Is it possible to attach a method to the arrows button of an ultrascrollbar ?
I want that when the user press the "<" arrow of the scrollbar and then the scrollbar's value is already set to the minimum, to jump back to the maximum value.
Thanks for your feedbacks !
Hi Yannick,
That's a very unusual use of a ScrollBar. Are you sure that won't be confusing to your users? I don't know of any application in which the scrollbars wrap around.
There's no property on the control to make it wrap around. You might be able to acheive this using the Scroll event, though. The Scroll event fires when you click the left arrow even when the scrollbar is already at the minimum value. So you could try to detect this. But it would be very tricky for a couple of reasons.
First, you cannot set the scrollbar's Value inside this event. So you would have to use a BeginInvoke to set the value in a separate method.
Also, if you want the wrapping around to work both ways, you would have to have code to prevent your code from causing infinite recursion. So when the user clicks the left arrow, for example, you could set the Value of the scrollbar to it's Maximum, but you have to make sure that this doesn't trigger another Scroll event which then sets the value back to the Minimum.