Solved

Selecting Item in ListView Box

Posted on 2002-05-03
4
136 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
Comment Utility
Make sure you have the fullrowselect property set to True and the HideSelection property set to False.




0
 

Author Comment

by:jackjeckyl
Comment Utility
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
Comment Utility
Ahh, EnsureVisible property will do that.  Thanks for your help.
0
 
LVL 4

Expert Comment

by:RichW
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now