Results 1 to 3 of 3

Thread: [RESOLVED] Find item not working with MS common dailog control 6.0

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2008
    Posts
    84

    Resolved [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

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2008
    Posts
    84

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width