Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sorting the filelistbox

Posted on 1997-12-12
4
Medium Priority
?
377 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 600 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…
Suggested Courses

972 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