Public Class Form1 Public Event TreeViewScroll As EventHandler
Private Sub Form1_TreeViewScroll(sender As Object, e As EventArgs) Handles Me.TreeViewScroll 'ListBox1.Items.Insert(0, "Scrolled at " & Now.ToString("HH:mm:ss.fff")) End Sub
Private topNode As TreeNode = Nothing Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick If TreeView1.TopNode IsNot Nothing Then If topNode IsNot TreeView1.TopNode Then topNode = TreeView1.TopNode RaiseEvent TreeViewScroll(TreeView1, EventArgs.Empty) End If End If End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Timer1.Interval = 150 Timer1.Start() End Sub End Class