本文整理汇总了VB.NET中System.Windows.Forms.ListView.CacheVirtualItems事件的典型用法代码示例。如果您正苦于以下问题:VB.NET ListView.CacheVirtualItems事件的具体用法?VB.NET ListView.CacheVirtualItems怎么用?VB.NET ListView.CacheVirtualItems使用的例子?那么恭喜您, 这里精选的事件代码示例或许可以为您提供帮助。您也可以进一步了解该事件所在类System.Windows.Forms.ListView 的用法示例。
在下文中一共展示了ListView.CacheVirtualItems事件的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的VB.NET代码示例。
示例1: Not
'Manages the cache. ListView calls this when it might need a
'cache refresh.
Private Sub listView1_CacheVirtualItems(ByVal sender As Object, ByVal e As CacheVirtualItemsEventArgs) Handles listView1.CacheVirtualItems
'We've gotten a request to refresh the cache.
'First check if it's really neccesary.
If Not (myCache Is Nothing) AndAlso e.StartIndex >= firstItem AndAlso e.EndIndex <= firstItem + myCache.Length Then
'If the newly requested cache is a subset of the old cache,
'no need to rebuild everything, so do nothing.
Return
End If
'Now we need to rebuild the cache.
firstItem = e.StartIndex
Dim length As Integer = e.EndIndex - e.StartIndex + 1 'indexes are inclusive
myCache = New ListViewItem(length) {}
'Fill the cache with the appropriate ListViewItems.
Dim x As Integer = 0
Dim i As Integer
For i = 0 To length
x = (i + firstItem) * (i + firstItem)
myCache(i) = New ListViewItem(x.ToString())
Next i
End Sub
开发者ID:VB.NET开发者,项目名称:System.Windows.Forms,代码行数:25,代码来源:ListView.CacheVirtualItems
注:本文中的System.Windows.Forms.ListView.CacheVirtualItems事件示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论