Event When A Change Is Complete
Use MouseCaptureChanged event with this
if (!srlTimeline->Capture) //Don't do if scroll bar is being dragged (only do if this is the release event)
{
Scroll Event
This is a general event that is triggered for many things, such as the scroll bar is moved to a new position. Use its arguments to drill down into getting particular events.
private: System::Void srlTimeline_Scroll(System::Object^ sender, System::Windows::Forms::ScrollEventArgs^ e)
{
if (e->Type = ScrollEventType::EndScroll)
{
MessageBox.Show("User has finished scrolling")
}
}
ScrollEventArgs
EndScroll The scroll box has stopped moving.
First The scroll box was moved to the Minimum position.
LargeDecrement The scroll box moved a large distance. The user clicked the scroll bar to the left(horizontal) or above(vertical) the scroll box, or pressed the PAGE UP key.
LargeIncrement The scroll box moved a large distance. The user clicked the scroll bar to the right(horizontal) or below(vertical) the scroll box, or pressed the PAGE DOWN key.
Last The scroll box was moved to the Maximum position.
SmallDecrement The scroll box was moved a small distance. The user clicked the left(horizontal) or top(vertical) scroll arrow, or pressed the UP ARROW key.
SmallIncrement The scroll box was moved a small distance. The user clicked the right(horizontal) or bottom(vertical) scroll arrow, or pressed the DOWN ARROW key.
ThumbPosition The scroll box was moved.
ThumbTrack The scroll box is currently being moved.
Value Changed Event
Occurs every time the value changes (either by user or when you set the value)
Is a Scroll Bar Currently Being Dragged With The Mouse
if (!srlTimeline->Capture) //Don't do if scroll bar is being dragged
The Maximum Value Can't Be Reached!
The maximum value of a scroll bar can only be reached programmatically. The value of a scroll bar cannot reach its maximum value through user interaction at run time. The maximum value that can be reached through user interaction is equal to 1 plus the Maximum property value minus the LargeChange property value. So an easy way round this is to set the maximum to (Max Value + Large Change Value – 1)
MyScrollBar->Maximum = MyMaxValue + ChartScrollBar->LargeChange - 1