Solved

Sorting the filelistbox

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 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…

708 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

19 Experts available now in Live!

Get 1:1 Help Now