查看
GetScrollRange
和
GetScrollPos
API …
Private Const SBS_HORZ = 0 Private Const SBS_VERT = 1 <DllImport("user32.dll")> _ Public Function GetScrollRange(ByVal hWnd As IntPtr,ByVal nBar As Integer,_ ByRef lpMinPos As Integer,_ ByRef lpMaxPos As Integer) As Boolean End Function <DllImport("user32.dll")> _ Public Function GetScrollPos(ByVal hWnd As Integer,_ ByVal nBar As Integer) As Integer End Function // ... Dim scrollMin as Integer = 0 Dim scrollMax as Integer = 0 If(GetScrollRange(rtb.Handle,SBS_VERT,scrollMin,scrollMax) Then Dim pos as Integer = GetScrollPos(rtb.Handle,SBS_VERT) // Detect if they're at the bottom EndIf
笔记:
要确定滚动条是否可见,请调用GetWindowLong
并检查WS_VSCROLL
要确定滑块可以达到的最大值,请调用GetScrollInfo
;我认为最大值是
scrollMax - largeChange + 1