Solved

FileListBox Pattern

Posted on 2001-07-16
8
1,618 Views
Last Modified: 2012-08-13
Hi,

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?

Thanks!
0
Comment
Question by:meravkn
[X]
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
8 Comments
 
LVL 11

Expert Comment

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

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

0
 
LVL 39

Expert Comment

by:appari
ID: 6284947
are you setting the correct Path?

try setting

filFileBox.Path property and check
0
 
LVL 39

Accepted Solution

by:
appari earned 50 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"

Rao
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 39

Expert Comment

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

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

Rao
0
 
LVL 11

Expert Comment

by:Otana
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.
0
 
LVL 1

Expert Comment

by:hakob
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.

0
 
LVL 43

Expert Comment

by:TimCottee
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.
0
 
LVL 1

Author Comment

by:meravkn
ID: 6286826
That worked! thank you very much!
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

690 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