Hi, All:
When using AutoScroll feature, the UserControl moves the unchanged
part and only paints the changed part.
This only works under following situations:
1. when OnPaint() function always paints the entire view
eg: OnPaint() always draws 100 lines of text, even some lines
are invisible.
2. OnPaint() method only paints the visible portion, but they are
painted exactly same as if the entire view is painted.
If it paints differently, it will not work.
My program is painting a list of lines. What I want do implement
is no matter user use pagedown/pageup, or arrow key, or click the
scroll
bars, the control paints based on lines. So the position of the
first visible line is always fixed.
If I paint all the lines or calculate the position of the first line
as if all lines are painted, the scroll works fine. but the position
of the first visible line changes. When I press pagedown, it scrolls
the height of the control, which may result in showing bottm half of
the last line on top.
If I fix the position of the first line, it will not paint
correctly.
The new lines are not showing until another window covers and
uncover
the control. This means the program actually paints all new lines,
but
they are invisible.
Can anyone explain what's happening?
Cheers
shane