
Keeping VScroll.Value=VScroll.max
I have a picturebox to which I am writing lines. I have a vertical
scrollbar to scroll through the visible lines. For example, I may have 30
lines and the picture box displays any consecutive 30. The vertical scroll
bar defines which 30 to display. (Similar to simple word processing, such
as NotePad).
I then add a block of lines to the end, and I want to simultaneously scroll
to the end. To do this I increase VScroll.Max by the number of lines added
and then I increase V.Scroll.Value to the new max. The problem is that the
scroll bar first moves the bar up a little (when max is increased, because
the value is then less than max) and then moves it back to the bottom when
the value is set to the new max.
In Notepad, pasting lines continuously to the bottom does not cause this
scroll bar shudder. The scrollbar stays in the max position, while the max
and the value are both incremented.
How does it do that? How can I achieve the same with VB6's VScroll bar?
Any guidance would be appreciated. Thanks.
Nigel