hopefully this is an easy one!
I’m deriving from UserControl, and I am overriding OnPaint. I want this control to be scrollable, but all I want is to be able to get the value of the scroll bars and handle where to draw everything myself. I have set up the following:
// How the hell do I get this scrolling to not return to zero?
this.Scroll += new ScrollEventHandler(TimelineControl_Scroll);
this.HorizontalScroll.Enabled = true;
this.HorizontalScroll.Visible = true;
this.HorizontalScroll.Minimum = 0;
this.VerticalScroll.Enabled = false;
this.VerticalScroll.Visible = true;
this.AutoScroll = false;
I am seeing the new value of the scroll position. However, the scroll bars always return to zero. What am I doing wrong?
I cannot reverse-engineer what that code is trying to do. AutoScroll is your friend. Here’s an example: