Results 1 to 12 of 12

Thread: [RESOLVED] File Listbox... exclude?

  1. #1

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Resolved [RESOLVED] File Listbox... exclude?

    Is there a way to exclude types in the filter in a filelistbox?

    like <> *.log ?
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: File Listbox... exclude?

    Wouldn't is be simpler to just include what you do want?

  3. #3

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: File Listbox... exclude?

    no.. I need ALL but *.log
    so.. my thinking is that would be a LOOONG filter string
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: File Listbox... exclude?

    Well, File1.Pattern throws up all over the place if you try a put anything on it except an equal sign.

    I don't know what the common dialog would do. I'll test it out and see what happens.

  5. #5

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: File Listbox... exclude?

    .. needs to be a listbox..
    I'll just use a reg one an add to it as I loop through the files.. (I guess)
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: File Listbox... exclude?

    Quote Originally Posted by [A51g]Static
    Is there a way to exclude types in the filter in a filelistbox?

    like <> *.log ?
    Quote Originally Posted by [A51g]Static
    .. needs to be a listbox..
    You are confusing me. Are you using a filelistbox or a listbox?

  7. #7

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: File Listbox... exclude?

    I was using a FileListBox... but If I switch to a reg listbox I can filter them out myself
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  8. #8

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: File Listbox... exclude?

    Quote Originally Posted by [A51g]Static
    I was using a FileListBox... but If I switch to a reg listbox I can filter them out myself
    So, is this fixed or are you still having a problem?

  10. #10

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: File Listbox... exclude?

    yep go it working... thanks
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  11. #11
    New Member
    Join Date
    Apr 2012
    Location
    Medford, OR
    Posts
    5

    Re: [RESOLVED] File Listbox... exclude?

    For VB6 we had to switch to a ListView in place of FileList to get a solution ... here's the code:
    Code:
        ' get the list of excluded files
    Private Sub GetExcludedFiles(ByVal fileSelFile As ListView)
        Dim i As Long, names() As String
            names() = GetFiles("*.*")
            For i = 1 To UBound(names)
              tmp2 = LCase$(GetExtension(names(i)))
              If Not ((tmp2 = "exe") Or (tmp2 = "exp") Or (tmp2 = "obj") _
                Or (tmp2 = "for") Or (tmp2 = "lst") Or (tmp2 = "xmp") Or (tmp2 = "sld") _
                Or (tmp2 = "fc") Or (tmp2 = "fc0") Or (tmp2 = "graf") Or (tmp2 = "demo") _
                Or (tmp2 = "inc") Or (tmp2 = "bat") Or (tmp2 = "ktl") Or (tmp2 = "eer") _
                Or (tmp2 = "doc") Or (tmp2 = "rtf") Or (tmp2 = "jpg") Or (tmp2 = "gif") _
                ) Then
                    With fileSelFile.ListItems.Add(, , names(i)).ListSubItems
                    End With
              End If
            Next

  12. #12
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: [RESOLVED] File Listbox... exclude?

    OptimalDesigns, the original poster had already found the solution to their problem and while you have suggested another solution to the problem the original poster posted the nine years ago.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

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