|
-
March 19th, 1999, 12:13 PM
#1
Listview auto highlight
I have one question about Listview control. For example : User press
"Item One" in text box , after pressing enter . The software will search
"Item One" in Listview , if it find it , it will auto highlight this item .
if no this data , will appear message .
How do i make auto hightlight ?
Thank you for your help
Philip
-
March 19th, 1999, 12:27 PM
#2
Re: Listview auto highlight
Hi
This is quite simple, the ListView has a FindItem method which will search for a matching string in the listview (and in columns if you specify it - look at the help file for more info).
EG.
Dim li As ListItem
Set li = ListView1.FindItem("This is xline 75")
If li Is Nothing Then
MsgBox "Not Found"
Exit Sub
End If
li.EnsureVisible
Set ListView1.SelectedItem = li
Don't forget to set the 'HideSelection' property of the listview to false.
Regards
Chris Eastwood
CodeGuru - the website for developers
http://www.codeguru.com/vb
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|