Results 1 to 3 of 3

Thread: filelistbox: dam simple problem

Hybrid View

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2001
    Posts
    32

    filelistbox: dam simple problem

    hey guys,

    im using a fileListBox to get the names of files that exists in a folder....
    the screw up is that i dont want it to show the extention...

    for example....
    Run to you.mp3
    Crawling.mp3

    i only want to show...
    Run to you
    Crawling

    any ideas....???
    i dont want to ue the replace string function on the list on the FileListBox....

    i want ot directly get the names in the box without the extensions

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Sorry, using a FileListbox really limits you in many things. Try a regular listbox...
    VB Code:
    1. Private Sub Form_Load()
    2.     Call ListFiles("C:\*.*")
    3. End Sub
    4.  
    5. Private Sub ListFiles(ByVal Path As String)
    6. Dim s As String
    7.    
    8.     s = Dir$(Path)
    9.    
    10.     While (Len(s) > 0)
    11.         If InStr(1, s, ".") Then
    12.             s = Left$(s, InStr(1, s, ".") - 1)
    13.         End If
    14.  
    15.         Call List1.AddItem(s)
    16.         s = Dir$
    17.     Wend
    18.  
    19. End Sub
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2001
    Posts
    32
    thanx man...your idea was great....... thanx!!!!!!!!

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