Click to See Complete Forum and Search --> : FileListBox Problems


FunkstaFunkie
December 23rd, 1999, 12:44 AM
Is there a bug on Visual Basic 5.0 that involves the FileListBox not being able to read the files in a directory? I was trying to make a simple select file dialog and the control wasn't working. Then I ran the sample included in the CD that involved the FileListBox and it worked. I erased all the code, and it still worked. I'm just wondering why it wasn't working.

Thanks in advance,
funkstafunkie@hotmail.com

Noog
December 27th, 1999, 01:22 PM
Yes, there is... sometimes the "Mask" property doesn't work properly, expecially when multiple extensions are specified, or if lots of "wildcards" (* and ?) are used. Now my FileList control works fine, but I don't know why. Maybe the problem involves the runtimes, since even in compiled files the control can cause this sort of troubles (perhaps it has to do with some buried project settings - try changing your project's properties randomly and wildly, something could happen). You can also try reinstalling Vb: if FileListBox doesn't work even after this, the only possible solution is killing Bill Gates ;-)

You can also try this "trick":
- hide the file list box
- specify "*.*" as mask
- create a standard list box, and populate it during runtime with all elements contained in the file list. You can also "filter" the filenames using the string functions (left, right, mid, etc.), in order to show only the file types you want.

Hope this can help you, and sorry if I didn't give you the code to do the "trick" above, but I haven't tried it yet & I'm really too busy to do it right now. When I'll have some more free time, I'll send it to you.