Print Page | Close Window

Get first visible item on ListView

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=23178
Printed Date: 27 November 2024 at 4:42pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Get first visible item on ListView
Posted By: MohammadGH
Subject: Get first visible item on ListView
Date Posted: 02 November 2016 at 11:11am
hi :)
i'm trying  to get the first visible item on list view (view property = 0) by using "getFisrtVisible"  but it's always returns 1.
Here is a sample


Private Sub Form_Load()
Dim i As Integer
For i = 1 To 100
Dim item As ListViewItem
Set item = ListView1.ListItems.Add(, , "test")
item.SubItems(1) = CStr(i)
Next

ListView1.ListItems.item(50).EnsureVisible   ' scrolling the listview to item 50
i = ListView1.GetFirstVisible.Index 
End Sub







Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net