title: Limit the size of List(Of T) - VB.NET
body: <p>I am trying to limit the size of my generic list so that after it contains a certain amount of values, it won't add any more.</p>
  
  <p>I am trying to do this using the Capacity property of the List object, but this does not seem to work.</p>
  
  <pre><code>        Dim slotDates As New List(Of Date)
          slotDates.Capacity = 7
  </code></pre>
  
  <p>How would people advice limiting the size of a list?</p>
  
  <p>I am trying to avoid checking the size of the List after each object is added.</p>