[RESOLVED] Find item not working with MS common dailog control 6.0
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
Re: Find item not working with MS common dailog control 6.0
Do you have both the version 5 and version 6 listviews in your toolbox. If so,
1. Either remove the version 6 if no longer used
2. Else try this: Dim lvItem As ComctlLib.ListItem
FYI: ComctlLib is v5, MSComctlLib is v6
Re: Find item not working with MS common dailog control 6.0
thnx a lot bro, actually i hate 1 thing MSComctlLib dont get xp theme when manifest is applied, so for that reason i was using both version !!, is there any way to have proper manifest for 6.0 controls?