Return to Snippet

Revision: 57674
at June 5, 2012 07:10 by jshultz4


Initial Code
#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

Initial URL


Initial Description
Tested on multiline textbox and listview.

Initial Title
Auto Scrolling Controls

Initial Tags


Initial Language
VB.NET