FileListBox won't display long file names

I'm using a FileListBox in one of my projects. It is populated using the change event on a DirListBox (FileListBox.path = DirListBox.path). The problem that I've got is that when a directory name has a space in it the file list box does not diplay the full file name. It only shows the first eight characters then the extension. When the files have the same first eight character it substitutes the last two characters for numbers i.e. testfil1, testfil2 etc. Does anyone know why this is and how if can be remedied?

Many thanks,


Who is Participating?
Anthony PerkinsConnect With a Mentor Commented:
THe FileListBox, DriveListbox and DirListBox for the most part are deprecated controls.  Take a look at these two articles from MSDN:
PRB: FileListBox Control May Not List File Names Properly (Q196028);en-us;Q196028&SD=MSKB&
PRB: Problems Using Intrinsic File System Controls (Q196141);en-us;Q196141

Guy Hengel [angelIII / a3]Billing EngineerCommented:
This is probably because of your version of VB, i guess you have VB5...
dustybrynAuthor Commented:
I'm using VB6 Enterprise Edition, try it for yourself.
Guy Hengel [angelIII / a3]Billing EngineerCommented:
In fact, for me the controls work fine...
So I can only suggest what is said in the articles of acperkins: develop your own routines for this, using either DIR() function, the Scripting.Filesystem object or (for hardcore developers) some API functions.

BTW, I don't use those controls except for creating some demo programs...

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.