title: How to change a value in list of class?
body: <p>Given a class like so</p>
  
  <pre><code>Public Class ItemPanel
  
      Inherits Panel
  
      Public Name as string
      Public Quantity As Integer
  
  End Class
  </code></pre>
  
  <p>And a list like so</p>
  
  <pre><code>Public li_ip As New List(Of ItemPanel)
  </code></pre>
  
  <p>I have a sub will help me add ItemPanel to li_ip list when a button clicked, every button clicked will also add their text into li_item, so when a button click twice, only the first time will add ItemPanel to li_ip, second click will only change the quantity in ItemPanel</p>
  
  <pre><code>Private Sub RefreshOrdered(sender As Object)
          If Not li_item.Contains(sender.Text) Then
  
              Dim pn As ItemPanel
              With pn
                  .Name = sender.Text
                  .Quantity = 1
              End With
  
              li_ip.Add(pn)
  
          Else
  
              'Here I want to change the quantity in ItemPanel depend on the sender.Text
  
          End If
  End Sub
  </code></pre>
  
  <p>So how can I get the result I want? What should I write after else?</p>