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
Solved

Clear a FileListBox

Posted on 2004-04-22
6
1,271 Views
Last Modified: 2011-10-07
Hello Experts,
How do you clear the contents of a filelistbox with a click of a button?

cheers.
0
Comment
Question by:sayeed_seher
  • 3
  • 3
6 Comments
 
LVL 2

Expert Comment

by:sbennetts
ID: 10888790
The filelist box is listing the files in the path specified in the path property, you either need to change your path, change your pattern to something that doesn't exist (e.g. *.qza) or make the filelist box invisible.
Simon.
0
 

Author Comment

by:sayeed_seher
ID: 10888835
can I get a code example?
0
 
LVL 2

Expert Comment

by:sbennetts
ID: 10888883
To do which?

myForm.myFileListBox.visible = false

will do it or

myForm.myFileListBox.pattern = "*.qza" 'or another file extension...

Simon.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 

Author Comment

by:sayeed_seher
ID: 10889010
I apologize for the confusion, I should have been clearer in the begining. I have a directorylistbox which when I select a folder, shows the contents in the filelistbox. The user can then select a file from the filelistbox. I would like to put a button that will keep the filelistbox visible, yet clear the contents and at the same time not set the pattern or path because that will not allow it to work with the directorylistbox. Hope that helps.
0
 
LVL 2

Accepted Solution

by:
sbennetts earned 125 total points
ID: 10889113
But the filelistbox has a path and will display the files in that path, until the path or pattern changes, the files in that path will always be displayed.

The best option would be the pattern option to change it to something crazy, then when you want to change the directorylistbox, it sets the path and pattern accordingly...
0
 

Author Comment

by:sayeed_seher
ID: 10889179
Thanks for your help!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

809 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