程序如下:
Private Function GetVScollBarOfListView() As VScrollBar
Dim objControl As Control
Try
'''
For Each objControl In Me.lvwVerifyInfo.Controls
If objControl.GetType() Is GetType(VScrollBar) Then
Return objControl
End If
Next
'''异常处理
Catch ex As Exception
ProjectException.ShowErrMsg(Me.Name, "GetVScollBarOfListView", ex.Message)
End Try
End Function
为什么没有子控件呢?我要实现的功能是
将指定ListViewItem的显示在ListView中
也就是让VScollBar滚动到指定ListViewItem可见
需要获得VScollBar
请大家帮帮忙
Private Function GetVScollBarOfListView() As VScrollBar
Dim objControl As Control
Try
'''
For Each objControl In Me.lvwVerifyInfo.Controls
If objControl.GetType() Is GetType(VScrollBar) Then
Return objControl
End If
Next
'''异常处理
Catch ex As Exception
ProjectException.ShowErrMsg(Me.Name, "GetVScollBarOfListView", ex.Message)
End Try
End Function
为什么没有子控件呢?我要实现的功能是
将指定ListViewItem的显示在ListView中
也就是让VScollBar滚动到指定ListViewItem可见
需要获得VScollBar
请大家帮帮忙
'''查找的项可见
Me.lvwVerifyInfo.EnsureVisible(Me.lvwVerifyInfo.SelectedItems(0).Index + 10)