Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding file extensions in a FileListBox

Status
Not open for further replies.

mookie0001

Technical User
Jun 14, 2002
23
US
Hi,
1. I currently have a FileListBox setup to show only one file type using the Pattern option in VB 6. Because all files are of the same type, I would like to hide the file extensions for user friendliness. Is there a simple fix to do this? If not, what are my best options to do this?

2. In another FileListBox, I would like to restrict the box to show only two file types. As stated above, I am using the Pattern option to filter out other file types. However, I cannot get the Pattern to limit all but two file types. I have tried several combinations of commas and semi-colons such as [*.doc, *.txt] and [*.doc; *.txt] with no success. What am I doing wrong?

A solution to these problems would be greatly appreciated. Thanks!

-Chris
 
Try this:

File1.Pattern = "*.txt;*.doc"

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
I know no easy way to do it... I assume you could take and run a filter that removes the extension... then run them to a listbox that adds them without the extension... then you need to let it konw that when marysue is selected in the listbox it should play marysue.mp3 from the filelistbox... works in theory i guess good luck
 
File1.Pattern = "*.txt;*.doc" produces only the .doc files being populated into the box. For whatever reason it seems to ignore everything except the last filter option.

Chtrips - that's what I was afraid of. I was just hoping that there was an easier way. Thanks though.

Any other suggestions for the pattern problem??
 
File1.Pattern = "*.txt;*.doc" definitely works for me using VB6 SP5 in W2K and XP

Have you got SP5 on?
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top