DataGridView实现监视滚动事件..处理当DataGridview 中的 ScrollBar滚动到 底部时的情况..
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load For i = 0 To 100 DataGridView1.Rows.Add(New DataGridViewRow) Next Dim pi = GetType(DataGridView).GetProperty("VerticalScrollBar", Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic) Dim sr As ScrollBar If pi <> Nothing Then sr = pi.GetValue(DataGridView1, Nothing) End If If sr IsNot Nothing Then AddHandler sr.Scroll, AddressOf EndScroll End If End Sub Private Sub EndScroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) If e.Type = ScrollEventType.EndScroll Then If CType(sender, VScrollBar).Value = CType(sender, VScrollBar).Maximum - CType(sender, VScrollBar).LargeChange + 1 Then MsgBox("EndScroll" & CType(sender, VScrollBar).Value) For i = 0 To 10 DataGridView1.Rows.Add(New DataGridViewRow) Next End If End If End Sub