I have searched the internet far and wide and seen many questions like this, but I have not seen an actual answer.
I have a rich text box control with lots of text in it. It has some legal information in this control. By default the "Accept" button is disabled. I want to detect on the scroll event if the position of the v-scroll bar is at the bottom. If it is at the bottom, enable the button.
How would I detect the current v-scroll bar position?
Thank You!
EDIT I am using WinForms (.Net 4.0)
This should get you close to what you are looking for. This class inherits from the RichTextBox and uses some pinvoking to determine the scroll position. It adds an event
ScrolledToBottom
which gets fired if the user scrolls using the scrollbar or uses the keyboard.This is then how it can get used:
Tweak as necessary.
The following works very well in one of my solutions:
The question How to get scroll position for RichTextBox? could be helpful, Check out this function