[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


FileListBox Pattern

Posted on 2001-07-16
Medium Priority
Last Modified: 2012-08-13

In my application, I need the FileListBox to display only files with these extentions: BMP, GIF, JPEG.

I use this syntax:

filFileBox.Pattern = "*.BMP; *.JPEG; *.GIF"

But it doesn't work. I can see the DirListBox items, and the DriveListBox too, but I can't see anything in the FileListBox...why?

Question by:meravkn
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 11

Expert Comment

ID: 6284902
I believe the pattern property is case sensitive. try this:

filFileBox.Pattern = "*.BMP; *.bmp; *.JPEG; *.jpeg; *.GIF; *.gif"

LVL 39

Expert Comment

ID: 6284947
are you setting the correct Path?

try setting

filFileBox.Path property and check
LVL 39

Accepted Solution

appari earned 200 total points
ID: 6284974
actually this is problem because of spaces in pattern string. try removing spaces

filFileBox.Pattern = "*.BMP;*.bmp;*.JPEG;*.jpeg;*.GIF;*.gif"

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

LVL 39

Expert Comment

ID: 6284979
actually this is problem because of spaces in pattern string. try removing spaces

filFileBox.Pattern = "*.BMP;*.JPEG;*.GIF"

LVL 11

Expert Comment

ID: 6284987
appari is right. remove the spaces from your string. the Microsoft Help File is incorrect on this: it shows an example using spaces, but it doesn't work.

Expert Comment

ID: 6285007
Perhaps you have missing something. Please, follow the steps to create a sample project. then compare with your:

1. Create a standard EXE project. Form1 is created by default.

2. Place a FileList box (File1) on Form1.

3. Place a CommandButton on Form1 and place the following code in the click event:

File1.Path = "c:\windows" ' Put here your windows dir or
                          ' some other dir.    
File1.Pattern = "*.bmp; *.gif; *.jpeg"
Press the F5 key to run the application the files with the crresponding extention are displayed in the FileListBox.

LVL 43

Expert Comment

ID: 6285868
hakob, please re-read the guidelines on comments vs answers at the bottom of this page. You have submitted an "answer" which adds nothing to the thread, noting that the correct solution has already been supplied in a number of comments and that your "answer" is incorrect in that it still includes the spaces that are the root of this problem. If you continue to post "answers" in this manner your account will be referred to customer services for possible penalty. You are not new to EE so should be more than aware of the protocol on this site.

Author Comment

ID: 6286826
That worked! thank you very much!

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question