• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 156
  • Last Modified:

Selecting Item in ListView Box

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
jackjeckyl
Asked:
jackjeckyl
  • 2
  • 2
1 Solution
 
RichWCommented:
Make sure you have the fullrowselect property set to True and the HideSelection property set to False.




0
 
jackjeckylAuthor Commented:
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
 
jackjeckylAuthor Commented:
Ahh, EnsureVisible property will do that.  Thanks for your help.
0
 
RichWCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now