Solved

Sorting the filelistbox

Posted on 1997-12-12
4
368 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

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

828 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