Solved

ListView Object

Posted on 2002-06-16
4
200 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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

685 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