Solved

Selecting Item in ListView Box

Posted on 2002-05-03
4
137 Views
Last Modified: 2010-05-02
I have a search button that I want to search the first column of a listview box.  Once it finds it, I want that row in the listview box highlighted.  Here's what I got so far which works, but does not highlight.  

intX = 1

Do Until ListView1.SelectedItem = Trim(txtSearchDDA.Text)
    ListView1.SelectedItem = ListView1.ListItems.Item(intX)
    intX = intX + 1
Loop
0
Comment
Question by:jackjeckyl
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
RichW earned 50 total points
ID: 6989212
Make sure you have the fullrowselect property set to True and the HideSelection property set to False.




0
 

Author Comment

by:jackjeckyl
ID: 6991265
OK, that works.  Is there a way to have it automatically scroll down to the one that is selected?  In other words, if the one that is selected is all the way down the listview box, once it has found it can I have it where it will be shown in the listview box?
0
 

Author Comment

by:jackjeckyl
ID: 6991350
Ahh, EnsureVisible property will do that.  Thanks for your help.
0
 
LVL 4

Expert Comment

by:RichW
ID: 6991565
Sorry I didn't get back sooner.  EE just sent me 12 emails all at one time, so I didn't know you asked another question.

Glad I could help.
RichW
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

776 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