my question is as is:How to detect if a scrollbar is at or not at the end of a richtextbox?
edit: when I say at the end I mean completely scrolled to the bottom, not anywhere else.
my question is as is:How to detect if a scrollbar is at or not at the end of a richtextbox?
edit: when I say at the end I mean completely scrolled to the bottom, not anywhere else.
Sorry, you'll have to convert that to VB.NET yourself. Shouldn't be too hard :)
I used this code to get the current and maximum positions correctly:
It's tedious to get the "correct" maximum value. You have to substract the nPage (large change) value of the max value GetScrollRange returns, and then you can compare it with the HScrollPosition property correctly, like:
One method is to use the GetScrollPos function. Here's kind of a long winded example of it using VB.NET.
http://www.codeproject.com/KB/vb/VbNetScrolling.aspx?print=true
Check out the
GetScrollRange
andGetScrollPos
API...Notes:
To determine if the scrollbar is visible, call
GetWindowLong
and check forWS_VSCROLL
To determine the max value the slider can get to, call
GetScrollInfo
; I think the maximum value is