Solved

ListView Object

Posted on 2002-06-16
4
198 Views
Last Modified: 2010-05-02
ListView obect display a number of records.
how can i select ,for example last record ,in the program
(without mouse or keyboard)
I can't find any method which can do it in the listview.
Thanks .
0
Comment
Question by:Vadimka
  • 2
4 Comments
 
LVL 33

Expert Comment

by:hongjun
ID: 7081354
Try this

Dim i As Integer

i = 2 ' 2 means second record
ListView1.ListItems(i).Selected = True



hongjun
0
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 50 total points
ID: 7081412
to select last item in the list view

  ListView1.ListItems(ListView1.ListItems.Count).Selected = True
  ListView1.SetFocus
0
 
LVL 1

Expert Comment

by:Vinda
ID: 7087502
lIndex = ListView1.ListItems.Count

ListView1.ListItems(lIndex).Selected = True
ListView1.ListItems(lIndex).EnsureVisible

This should solve the problem
0
 
LVL 33

Expert Comment

by:hongjun
ID: 7098691
Vadimka, any reply?

hongjun
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
vb6 programatically bring window to front 8 70
Excel Vlookup to move data back to source. 4 90
Problem to With line 4 57
Publisher:   Unknown     VB.exe Application 1 19
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question