List(Of T) supports sorting through it's Sort method. When you call Sort it will use the default comparer for the items it contans. So if you have a custom class in there, you need to implement IComparable or IComparable(Of T).
Here is some code that shows how to do this. This code sorts lowest to highest.
Public Function CompareTo(ByVal other As CustomClass) As Integer Implements System.IComparable(Of CustomClass).CompareTo Dim myscore As Integer = Me.SomeValue Dim otherscore As Integer = other.SomeValue If myscore > otherscore Then Return 1 ElseIf myscore = otherscore Then Return 0 Else Return -1 End If End Function
Remember Me
Powered by: newtelligence dasBlog 1.9.6264.0
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
E-mail
Theme design by Jelle Druyts