How do I cycle through the items in a ListView1?

Post

Posted
Rating:
#1 (In Topic #1126)
Enthusiast
gambafeliz is in the usergroup ‘Enthusiast’
 Hi

How do I cycle through the items in a ListView1?

I load them with key and value with ADD. And what I want to do is loop through the values of all the rows to change the color as the user types text that is equal to the value.

For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
Online now: No Back to the top

Post

Posted
Rating:
#2
Enthusiast
gambafeliz is in the usergroup ‘Enthusiast’
My solution:

Code (gambas)

  1. Public Sub txtFind_KeyRelease()
  2.    
  3.    For Each key As Integer In ListView1.Keys
  4.       If String.InStr(UCase(ListView1[key].Text), UCase(txtFind.Text)) <> 0 Then
  5.          ListView1[key].Foreground = Color.Blue
  6.       Else
  7.          ListView1[key].Foreground = Color.Default
  8.       Endif
  9.    Next
  10.    ListView1.Refresh
  11.    
  12.  

For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
Online now: No Back to the top
1 guest and 0 members have just viewed this.