I'll start by what I'm trying to have happen:
I have data loaded in a range, where, say, scrolling all the way to the left puts me on April 1, and scrolling all the way to the right puts me on June 1.
The user positions the scrollbar on April 1st, and clicks the left arrow on the scrollbar. Now the scrollbar is positioned at March 31, and the range of data now spans from March 1-June 1.
Here's my problem:
I have been handling the left-arrow-click in the Scroll event handler (roughly as follows):
private void horizontalScroll_Scroll(object sender, ScrollEventArgs e)
{
if (LeftArrowClicked())
{
horizontalScroll.Maximum = calculateNewMaximum(earliestDate, latestDate);
horizontalScroll.Value = calculateNewPosition(currentDate.AddDays(-1), earliestDate);
}
}
Stepping through with the debugger, the moment it leaves this event handler, horizontalScroll.Value drops to 0, while horizontalScroll.Maximum stays at the correct value.
I'll post back later with any clarifications, and answers to questions.