Page 1 of 1

Vertical scroll position in TRichView

Posted: Sat Sep 21, 2019 1:45 pm
by Shouldercannon
Please tell me how you can track the event when the scroll is at the very top in TRichView.

Re: Vertical scroll position in TRichView

Posted: Sun Sep 22, 2019 9:09 am
by Sergey Tkachenko
OnVScrolled event, check VScrollPos property (it is in range 0...VScrollMax)

Re: Vertical scroll position in TRichView

Posted: Fri Dec 13, 2019 9:12 am
by Shouldercannon
VScrolled works only once when the slider reaches the top.
Can I make the VScrolled event fire until the slider is scrolling up from the keyboard or mouse wheel?

Re: Vertical scroll position in TRichView

Posted: Fri Dec 13, 2019 12:06 pm
by Sergey Tkachenko
OnVScrolled occurs on any scroll. Keyboard, scrollbar, mouse wheel, mouse panning, touch screen swipe - it does not matter, the event is called when a vertical position is changed.

Re: Vertical scroll position in TRichView

Posted: Fri Dec 13, 2019 3:52 pm
by Shouldercannon
I’ll clarify the question. So I scrolled the list with the mouse wheel up and the VScrolled event worked. I continue to scroll the list with the mouse wheel up, but again the VScrolled event no longer fires until I scroll down the speaker a little down, and then again up to the end.

Re: Vertical scroll position in TRichView

Posted: Fri Dec 13, 2019 4:22 pm
by Sergey Tkachenko
I still do not understand.
OnVScrolled is called when vertical position (value of VScrollPos property) is changed. It does not matter how it is changed.
If you want to detect attempts to scroll further than possible (for example, scrolling to the top when document is already scrolled to the top), you can use:
- OnMouseWheel, OnMouseWheelUp, OnMouseWheelDown for mouse wheel
- OnCaretGetOut for pressing UP arrow at the top line or DOWN arrow at the bottom line.