Code:Private Function FindInLV(theItem As String) As Long On Error GoTo HELL Dim lvItem As ListItem Set lvItem = yGamesOwner.lvUsers.FindItem(theItem, 1, , 0) FindInLV = lvItem.Index Set lvItem = Nothing HELL: If Err.Number > 0 Then FindInLV = 0 Err.Clear End If End Function
this code was working fine till i was using 5.0 control, i dont know much about list view, but this is how i checked it when it stopped working
Code:Public Sub LoginStat(theUsername As String, theStatus As String) Dim X As Integer X = FindInLV(theUsername) If X > 0 Then yGamesOwner.lvUsers.ListItems(X).SubItems(2) = theStatus End If End Sub Private Function FindInLV(theItem As String) As Long On Error GoTo HELL Dim lvItem As ListItem Set lvItem = yGamesOwner.lvUsers.FindItem(theItem, 1, , 0) FindInLV = lvItem.Index Set lvItem = Nothing HELL: If Err.Number > 0 Then FindInLV = 0 Err.Clear End If End Function
msgbox findinlv("classic")
its showing as 0




Reply With Quote