Vertical scroll position in TRichView
-
- Posts: 4
- Joined: Sat Sep 21, 2019 1:35 pm
Vertical scroll position in TRichView
Please tell me how you can track the event when the scroll is at the very top in TRichView.
- Attachments
-
- scroll.png (4.51 KiB) Viewed 24210 times
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Vertical scroll position in TRichView
OnVScrolled event, check VScrollPos property (it is in range 0...VScrollMax)
-
- Posts: 4
- Joined: Sat Sep 21, 2019 1:35 pm
Re: Vertical scroll position in TRichView
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?
Can I make the VScrolled event fire until the slider is scrolling up from the keyboard or mouse wheel?
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Vertical scroll position in TRichView
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.
-
- Posts: 4
- Joined: Sat Sep 21, 2019 1:35 pm
Re: Vertical scroll position in TRichView
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.
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Vertical scroll position in TRichView
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.
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.