/ Published in: VB.NET
Tested on multiline textbox and listview.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#Region " Auto Scrolling" <DllImport("User32.dll", CharSet:=CharSet.Auto, EntryPoint:="SendMessage")> _ Private Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr End Function Const WM_VSCROLL As Integer = 277 Const SB_BOTTOM As Integer = 7 Private Sub ScrollToEnd(ByVal obj As Object) Dim ptrWparam As New IntPtr(SB_BOTTOM) Dim ptrLparam As New IntPtr(0) SendMessage(obj.Handle, WM_VSCROLL, ptrWparam, ptrLparam) End Sub #End Region