title: VB.Net List.Find. Pass values to predicate
body: <p>Having a bit of trouble using the List.Find with a custom predicate</p>
  
  <p>i have a function that does this</p>
  
  <pre><code>private function test ()
      Dim test As Integer = keys.Find(AddressOf FindByOldKeyAndName).NewKey
  </code></pre>
  
  <p>here's the function for the predicate</p>
  
  <pre><code>Private Shared Function FindByOldKeyAndName(ByVal k As KeyObj) As Boolean
          If k.OldKey = currentKey.OldKey And k.KeyName = currentKey.KeyName Then
              Return True
          Else
              Return False
          End If
  
  
      End Function
  </code></pre>
  
  <p>by doing it this way means i have to have a shared "currentKey" object in the class, and i know there has to be a way to pass in the values i'm interested in of CurrentKey (namely, keyname, and oldkey)</p>
  
  <p>ideally i'd like to call it by something like 
  <code>keys.Find(AddressOf FindByOldKeyAndName(Name,OldVal))</code></p>
  
  <p>however when i do this i get compiler errors.</p>
  
  <p>How do i call this method and pass in the values?</p>