Results 1 to 2 of 2

Thread: Filelistbox and system colors...

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 1999
    Location
    ITALY
    Posts
    12

    Post

    How can I change the color of the scrollbar of a filelistbox without having to change system colors?
    How I can hide the extensions of the listed files?
    Thanks in advance.
    Paolo
    [email protected]

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    You can't change the color of the scrollbar without changing system colors...
    (Ok, maybe you can but it's very difficult)

    This is how you can hide the extensions:

    First, create a FileListBox (File1) and a ListBox (List1), then add this code:
    Code:
    Option Explicit
    
    
    Private Function LastInStr(ByVal String1 As String, ByVal String2 As String, Optional ByVal Start As Long = 0, Optional Compare As VbCompareMethod = vbBinaryCompare) As Long
        LastInStr = Start
        While InStr(LastInStr + 1, String1, String2, Compare)
            LastInStr = InStr(LastInStr + 1, String1, String2, Compare)
        Wend
    End Function
    
    
    Private Sub CopyLists(lstBoxDest As ListBox, filListBoxSrc As FileListBox)
        Dim I As Integer, S As String
        Call lstBoxDest.Clear
        For I = 0 To filListBoxSrc.ListCount - 1
            S = filListBoxSrc.List(I)
            S = Left(S, LastInStr(S, ".") - 1)
            Call lstBoxDest.AddItem(S)
        Next
    End Sub
    
    
    Private Sub File1_PathChange()
        Call CopyLists(List1, File1)
    End Sub
    
    
    Private Sub File1_PatternChange()
        Call CopyLists(List1, File1)
    End Sub
    
    
    Private Sub Form_Load()
        Dim I As Long
        File1.Visible = False
        Call CopyLists(List1, File1)
    End Sub
    ------------------
    Yonatan
    Teenage Programmer
    E-Mail: [email protected]
    ICQ: 19552879
    AIM: RYoni69

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