|
-
Nov 15th, 2001, 12:21 PM
#1
Thread Starter
Hyperactive Member
sorting a list box
i have a list box that i need to sort in decending order.. and when i check the sorted proporty it just does it in acending... is there anyway to set this to decending? or do ihave to write my own sort for this?
-
Nov 15th, 2001, 12:29 PM
#2
Frenzied Member
You could let the listbox sort it for you then put the items in an array and change the sorted property to false and input the array back in reverse order. Then you wouldn't have to deal with doing the actual sorting.
seoptimizer2001
VB 6.0, VC++, VI, ASP, JavaScript, HTML,
Perl, XML, SQL Server 2000
If God had intended us to drink beer, He would have given us stomachs.
Please use the [code] and [vbcode] tags in your posts!
If you don't know how to use them please go HERE!

-
Nov 15th, 2001, 12:34 PM
#3
Thread Starter
Hyperactive Member
hey thats kewl.. its almost too easy.. thanks for the help...
-
Nov 15th, 2001, 12:35 PM
#4
If you are populating your Listbox from a recordset, the easiest way is to sort the recordset at creation time by doing an ORDER BY, set the Listbox Sorted property to False, and dump the results in your Listbox.
-
Nov 15th, 2001, 12:46 PM
#5
Thread Starter
Hyperactive Member
i'm not useing a record set.. this is a PDF retreval program.. it scans across all of our servers serching for pdf files that contain the specified account number in the name.. and i need to have PDF files sorted in decending order in the list box so they see the newest pdf's first.. now i got a new question.. i'm useing the item data to hold the key to an array that stores the address of the pdfs... cuz i only show the user just the name of it.. how do i keep my itemdata accurate??
-
Nov 15th, 2001, 01:46 PM
#6
Frenzied Member
The new key to the array will be Ubound(YourArray) - original key.
seoptimizer2001
VB 6.0, VC++, VI, ASP, JavaScript, HTML,
Perl, XML, SQL Server 2000
If God had intended us to drink beer, He would have given us stomachs.
Please use the [code] and [vbcode] tags in your posts!
If you don't know how to use them please go HERE!

-
Nov 15th, 2001, 01:58 PM
#7
Thread Starter
Hyperactive Member
yep... i must be dense today.. sorry for being an idoit... thanks for the help!!
-
Nov 15th, 2001, 03:29 PM
#8
Thread Starter
Hyperactive Member
List1.Sorted = True
says i cant assign to a read only property... any other way to do this?
-
Nov 15th, 2001, 04:38 PM
#9
Frenzied Member
Have 2 Listboxes in the same place and use an invisible one to sort that has a sorted = true and another visible one that is set to Sorted = False, but you sort.
seoptimizer2001
VB 6.0, VC++, VI, ASP, JavaScript, HTML,
Perl, XML, SQL Server 2000
If God had intended us to drink beer, He would have given us stomachs.
Please use the [code] and [vbcode] tags in your posts!
If you don't know how to use them please go HERE!

-
Nov 15th, 2001, 05:07 PM
#10
Thread Starter
Hyperactive Member
yeah thats what i'm working on right now.. just tring to copy the itemdata to the new list box..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|