Scroll position jumps to 0

Hey,

Whenever I use the Scroll method on my canvas it always seems to jump back to 0 instantly. How could this be? I am changing the scroll value with a scrollbar in the ValueChanged event.

Thanks

Let me just pull out my psychic powers here.

Reading your code, reading your code, AH! It seems to be line 275.
:slight_smile:

[quote=165758:@Tim Parnell]Let me just pull out my psychic powers here.

Reading your code, reading your code, AH! It seems to be line 275.
:)[/quote]
Guess my psychic powers are not as good as your… from the code I see.… it looks fine :slight_smile:

In value changed event:

[code] // Calculate the delta that the scrollbar was
// moved and scroll the canvas accordingly.

Dim delta As Integer

delta = mVerticalScrollBarLast - Me.Value

delta = (delta / Me.Maximum) * Code.Height

mYScroll = mYScroll + delta

Code.Scroll(0, delta)

mVerticalScrollBarLast = Me.Value[/code]

Thanks

Are you scrolling horizontally or vertically?
Because one line you’re comparing the delta to the height, and the scroll line you’re scrolling horizontally.

Edit: or I flunked maths. I thought you graph up, and then over? Oh well. Shutting up now.

[quote=165823:@Tim Parnell]Are you scrolling horizontally or vertically?
Because one line you’re comparing the delta to the height, and the scroll line you’re scrolling horizontally.

Edit: or I flunked maths. I thought you graph up, and then over? Oh well. Shutting up now.[/quote]
Scrolling vertically.

How do you increase the scroll area?