Textbox or richtextbox, only thing i want is triggering a function when scrollbar moves.
I already found GetScrollPos and SetScrollPos. I thought of checking scrollbar position periodically but there must be a better way. So, what is the better way?
Update: Using WinForms
Assuming WinForms, you can try pinvoking:
Even better -- the hidden
MouseWheel
event: https://stackoverflow.com/a/26672097/1037948Adapted the accepted answer to include HorizontalScrollPosition and VerticalScrollPosition properties (to get and set the scroll positions) and ScrollChanged event (which uses .NET's ScrollEventArgs). ScrollChanged will also fire on key navigation and text modification as well as during selection drag, control resize, and font resize.