By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,511 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

Listbox sort

P: n/a
Hi,

I have a bit of a problem with a sort procedure I need to do. I have a
list of items in a listbox, eg:-

2.3%<A other text here>
-4%<B other text here>
10%<C other text here>
-9.3%<D other text here>
22%<E other text here>

How do I sort these listbox items in numerical descending order to:

22%<E other text here>
10%<C other text here>
2.3%<A other text here>
-4%<B other text here>
-9.3%<D other text here>

Thanks,
Alex

Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Ali Chambers" <in**@alexchambers.co.uk> schrieb:
I have a bit of a problem with a sort procedure I need to do. I have a
list of items in a listbox, eg:-

2.3%<A other text here>
-4%<B other text here>
10%<C other text here>
-9.3%<D other text here>
22%<E other text here>

How do I sort these listbox items in numerical descending order to:

22%<E other text here>
10%<C other text here>
2.3%<A other text here>
-4%<B other text here>
-9.3%<D other text here>


Use 'Array.Sort' with a custom comparer
(<URL:http://dotnet.mvps.org/dotnet/samples/codingtechnique/CompareOperator.zip>).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

P: n/a
Erm, how? I'm new to coding. Could you give an example.

Thanks.

Nov 21 '05 #3

P: n/a
Sorry - I missed your URL for the download. Do you have any
instructions on how to use the code?

Alex

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.