检查 RichTextBox ScrollBar thumb 是否在滚动条的底部
Imports System.Runtime.InteropServices
Public Class jMyBox
Inherits RichTextBox
Public Const OjbidVscroll As UInt32 = &HFFFFFFFBUI
<DllImport("user32.dll", SetLastError:=True, EntryPoint:="GetScrollBarInfo")>
Private Shared Function GetScrollBarInfo(hWnd As IntPtr,
idObject As UInt32,
ByRef psbi As ScrollBarInfo) As Integer
End Function
Public Function CheckBottom() As Boolean
Dim Info As New ScrollBarInfo
Info.CbSize = Marshal.SizeOf(Info)
Dim Res As Integer = GetScrollBarInfo(Handle, OjbidVscroll, Info)
If Info.RcScrollBar.Bottom = 0 Then Return True
Return Info.XyThumbBottom > (Info.RcScrollBar.Bottom - Info.RcScrollBar.Top - (Info.DxyLineButton * 2))
End Function
Public Structure ScrollBarInfo
Public CbSize As Integer
Public RcScrollBar As rect
Public DxyLineButton As Integer
Public XyThumbTop As Integer
Public XyThumbBottom As Integer
Public Reserved As Integer
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=6)>
Public Rgstate() As Integer
End Structure
Public Structure Rect
Public Left As Integer
Public Top As Integer
Public Right As Integer
Public Bottom As Integer
End Structure
end class参考:https://qa.1r1g.com/sf/ask/549065611/
我是郑鹏飞。
如果您觉得我的文章对您有帮助,可以点击站点上的 关于站点/支持和帮助
转载请注明 : 文章转载自不了阁-飞哥 blog.forbs.cn
本站文章除注明转载/出处外,均为本站原创或翻译。若要转载请务必注明出处,尊重他人劳动成果共创和谐网络环境。
转载请注明 : 文章转载自不了阁-飞哥 blog.forbs.cn
本站文章除注明转载/出处外,均为本站原创或翻译。若要转载请务必注明出处,尊重他人劳动成果共创和谐网络环境。





