Solved

Sorting the filelistbox

Posted on 1997-12-12
4
365 Views
Last Modified: 2008-02-01
I have a filelistbox with a pattern, but i want the files to show sorted on creation date and time.
How can i do that?
0
Comment
Question by:amannien
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 200 total points
ID: 1444938
The filelistbox doesn't allow you to do that. Instead, you can transfer the file nmaes to a listbox, and sort them as you want
0
 

Author Comment

by:amannien
ID: 1444939
Ok, but what do you mean by that?
I have to read all the files into an array, sort then and then show them in a listbox?

Isn't there an easier way to do this?
0
 
LVL 4

Expert Comment

by:rantanen
ID: 1444940
It won't help you. You want to sort them by date and time. If you even store them into the listbox so that there are only dates (which is not feasible), the sort won't work, because the stuff in the listbox is aplha is sorted as alpha, which gives quite different results than sorting by date.

The way to go is to abandon the filelistbox and use listview. Also listview has the same problems in sorting as such but it is possible to write additional code to do numeric sorting.
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1444941
He can sort an array, and then transfer it to a listbox
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

864 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now