Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Selecting Item in ListView Box

Posted on 2002-05-03
4
Medium Priority
?
147 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
RichW earned 200 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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…
Suggested Courses

610 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