Public Class CustomComparer
Implements IComparer
Public Function Compare(a As [Object], b As [Object]) As Integer
Dim item1 As IImGearThumbnailItem = DirectCast(a, IImGearThumbnailItem)
Dim item2 As IImGearThumbnailItem = DirectCast(b, IImGearThumbnailItem)
If item1.Page.DIB.Height < item2.Page.DIB.Height Then
Return -1
ElseIf item1.Page.DIB.Height > item2.Page.DIB.Height Then
Return 1
Else
' equal
Return 0
End If
End Function
End Class
' usage
' in InitializeComponent
Me.thumbnailCtl.Sort = ImageGear.Windows.Forms.Thumbnails.ImGearSortOptions.UserSort
Me.thumbnailCtl.SortComparer = New CustomComparer()