HI,
you create your own list class like in following console demo. Add insert item at the top of list.
Module Module64
Sub Main()
Try
Call (New Demo).Execute()
Catch ex As Exception
Console.WriteLine(ex.ToString)
End Try
Console.WriteLine("Continue enter key")
Console.ReadKey()
End Sub
Friend Class Demo
Friend Sub Execute()
Dim itemList As New MyList(Of String)(5)
For i = 1 To 7
itemList.Add($"Item {i}")
Next
For Each item In itemList
Console.WriteLine(item)
Next
End Sub
End Class
Friend Class MyList(Of T)
Inherits List(Of T)
Private _maxCount As Integer
Public Sub New(maxCount As Integer)
Me._maxCount = maxCount
End Sub
Friend Shadows Sub Add(item As T)
Me.Insert(0, item)
If Me.Count > Me._maxCount Then Me.RemoveAt(Me.Count - 1)
End Sub
End Class
End Module
Result: